/**
 * @描述：基础UI组件 构造函数
 * @开发人员：moshco zhu1
 * @开发日期：2010-8-15 下午02:00:24
 * @参数：oContainer, oParam
 * @返回值：any
 */
function FHBaseUI() {}

/**
 * @描述：显示一个模式对话框
 * @开发人员：moshco zhu1
 * @开发日期：2010-8-15 下午02:29:09
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUI.mdialog = function(strMsg, strBtnTitle, fn, oContainer, oCoverContainer) {
	// 创建消息对象
	var oDialog = new FHBaseUIDialog(oContainer, oCoverContainer);
	oDialog.mdialog(strMsg, strBtnTitle, fn);
	// 返回函数值
	return oDialog;
};

/**
 * @描述:非模式对话框
 * @开发人员:moshco zhu
 * @开发时间:2011-5-28 上午01:29:59
 * @param strMsg
 * @param strBtnTitle
 * @param fn
 * @param oContainer
 * @param oCoverContainer
 * @returns {FHBaseUIDialog}
 */
FHBaseUI.nmdialog = function(strMsg, strBtnTitle, fn, oContainer, oCoverContainer) {
	// 创建消息对象
	var oDialog = new FHBaseUIDialog(oContainer, oCoverContainer);
	oDialog.nmdialog(strMsg, strBtnTitle, fn);
	// 返回函数值
	return oDialog;
};

/**
 * @描述:无边界对话框
 * @开发人员:moshco zhu
 * @开发时间:2011-5-28 上午02:13:08
 * @param strMsg
 * @param oContainer
 * @param oCoverContainer
 * @returns {FHBaseUIDialog}
 */
FHBaseUI.mNoBorderDialog = function(strMsg, strBtnTitle, fn, oContainer, oCoverContainer) {
	// 创建消息对象
	var oDialog = new FHBaseUIDialog(oContainer, oCoverContainer);
	oDialog.mNoBorderDialog(strMsg, strBtnTitle, fn);
	// 返回函数值
	return oDialog;
};

/**
 * @描述：显示一个模式表单
 * @开发人员：moshco zhu1
 * @开发日期：2010-8-15 下午03:38:14
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUI.mformDialog = function(fnPaintForm, oContainer, oCoverContainer, oParam) {
	// 创建消息对象
	var oDialog = new FHBaseUIDialog(oContainer, oCoverContainer);
	oDialog.mformDialog(fnPaintForm, oParam);
	// 返回函数值
	return oDialog;
};

/**
 * @描述：显示一个查询列表模式对话框
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-11 下午06:37:16
 * @参数：oContainer, oCoverContainer, oParam
 * @返回值：any
 * @param oContainer
 * @param oCoverContainer
 * @param oParam
 * @return
 */
FHBaseUI.mlistDialog = function(oContainer, oCoverContainer, oParam) {
	// 创建消息对象
	var oDialog = new FHBaseUIDialog(oContainer, oCoverContainer);
	oDialog.mlistDialog(oParam);
	// 返回函数值
	return oDialog;
};

/**
 * @描述：创建一个下拉列表框
 * @开发人员：moshco zhu
 * @开发日期：2010-10-21 下午10:47:57
 * @参数：oContainer, oParam
 * @返回值：any
 * @param oContainer
 * @param oParam
 * @return
 */
FHBaseUI.combox = function(oContainer, oParam, bIsPaint) {
	// 组件对象
	var oCombox = new FHBaseUICombox(oContainer, oParam);
	if ((bIsPaint == null) || (bIsPaint)) {
		// 执行绘制
		oCombox.paint();
	}
	// 执行初始化
	oCombox.init();
	// 返回函数值
	return oCombox;
};

/**
 * @描述：递归选择器
 * @开发人员：moshco zhu
 * @开发日期：2010-11-13 下午07:23:02
 * @参数：oContainer, oParam, bIsPaint
 * @返回值：any
 * @param oContainer
 * @param oParam
 * @param bIsPaint
 * @return
 */
FHBaseUI.recurSelector = function(oTarget, oParam, bIsPaint) {
	// 组件对象
	var oIterateSelector = new FHBaseUIRecurSelector(oTarget, oParam);
	if ((bIsPaint == null) || (bIsPaint)) {
		// 执行绘制
		oIterateSelector.paint();
	}
	// 执行初始化
	oIterateSelector.init();
	// 返回函数值
	return oIterateSelector;
};

/**
 * @描述：创建一个日历组件
 * @开发人员：moshco zhu
 * @开发日期：2010-11-23 上午07:52:19
 * @参数：oTarget, oParam, bIsPaint
 * @返回值：any
 * @param oTarget
 * @param oParam
 * @param bIsPaint
 * @return
 */
FHBaseUI.calendar = function(oTarget, oParam, bIsPaint) {
	// 组件对象
	var oCalendar = new FHBaseUICalendar(oTarget, oParam);
	if ((bIsPaint == null) || (bIsPaint)) {
		// 执行绘制
		oCalendar.paint();
	}
	// 执行初始化
	oCalendar.init();
	// 返回函数值
	return oCalendar;
};

/**
 * @描述:初始化BaseUI组件
 * @开发人员:Administrator
 * @开发时间:2011-4-29 上午09:42:25
 * @param oContent
 * @param bIsPaint
 */
FHBaseUI.initBaseUIComponent = function(oContent, bIsPaint) {
	try {
		// 容器不能为空
		if (oContent == null || oContent.length != 1) {
			return;
		}
		// 下拉列表框组件
		bIsPaint = (bIsPaint == null) ? true : bIsPaint;
		oContent.find(".FHBaseUICombox").each(function() {
			if ($(this).outerHeight() > 0) {
				try {
					FHBaseUI.combox($(this), null, bIsPaint);
				} catch (e) {
				}
			}
		});
		// 递归选择器组件
		oContent.find(".FHBaseUIRecurSelectorTarget").each(function() {
			if ($(this).outerHeight() > 0) {
				try {
					FHBaseUI.recurSelector($(this), null, bIsPaint);
				} catch (e) {
				}
			}
		});
		// 日期组件
		oContent.find(".FHBaseUICalendarTarget").each(function() {
			if ($(this).outerHeight() > 0) {
				try {
					FHBaseUI.calendar($(this), null, bIsPaint);
				} catch (e) {
					alert("初始化日历组件出错了！" + e.message);
				}
			}
		});
	} catch (e) {
		// alert(e.message);
		alert("初始化BaseUI组件出错了！");
	}
};

// 实例化基础库对象
var FHBASEUI = new FHBaseUI();

// 实例化基础库对象
if (window.FHBASEUI == null) {
	window.FHBASEUI = FHBASEUI;
}

// 将FHBaseUI静态方法扩展到window对象
if (window.isExtendFHBaseUI == null || !window.isExtendFHBaseUI) {
	$.extend(window, FHBaseUI);
	$.extend(window, FHBASEUI);
	window.isExtendFHBaseUI = true;
}

/**
 * @描述：基础UI组件之 下拉列表框
 * @开发人员：moshco zhu
 * @开发日期：2010-10-21 下午10:46:01
 * @参数：
 * @返回值：any
 * @return
 */
function FHBaseUICombox(oContainer, oParam) {
	// 扩展基础组件对象
	var oComponentClass = {};
	$.extend(oComponentClass, FHBase);
	$.extend(oComponentClass, FHBaseUICombox);
	$.extend(FHBaseUICombox, oComponentClass);
	var oComponent = {};
	$.extend(oComponent, FHBase);
	$.extend(oComponent, FHBASE);
	$.extend(oComponent, this);
	$.extend(this, oComponent);
	// 容器
	this.Container = oContainer;
	// 设置目标组件的编码
	var strCode = random(8);
	this.Container.attr(FHBaseUICombox.ATTR_NAME_CODE, strCode);
	this.Container.attr(FHBaseUICombox.TARGET_ATTR_NAME_CODE, strCode);
	// 将组件引用存储
	saveBaseUI(this, strCode);
	// 组件参数模式
	if (oParam == null) {
		// 参数在容器div上
		// 字段名称
		var strName = oContainer.attr("name");
		this.Name = (strName != null) ? strName : ("name_" + strCode);
		// 默认值
		var strValue = oContainer.attr("value");
		this.Value = (strValue != null) ? strValue : null;
		// 列表高度
		var strListHeight = oContainer.attr("list-height");
		this.ListHeight = (strListHeight != null && !isNaN(strListHeight)) ? parseInt(strListHeight) : 120;
		// 数据列表
		var strDatas = oContainer.find(">span").html();
		// 将字符串分隔为2维数组
		var aryDatas = getArray(strDatas, [
				",", "="
		]);
		// 将2维数组转换为对象数组
		this.Datas = getObjectArray(aryDatas, [
				"code", "text"
		]);
		// 当值发送改变时
		var strOnChange = oContainer.attr("on-change");
		this.on_change = (strOnChange != null && strOnChange != "") ? strOnChange : null;
	} else {
		// 参数对象
		// 字段名称
		this.Name = (oParam != null && oParam.name != null) ? oParam.name : ("name_" + strCode);
		// 默认值
		this.Value = (oParam != null && oParam.value != null) ? oParam.value : null;
		// 列表高度
		this.ListHeight = (oParam != null && oParam.listHeight != null) ? oParam.listHeight : 120;
		// 数据列表
		this.Datas = (oParam != null && oParam.datas != null) ? oParam.datas : null;
		// 当值改变时运行
		this.on_change = (oParam != null && oParam.on_change != null) ? oParam.on_change : null;
	}
};

// 容器
FHBaseUICombox.prototype.Container = null;

// 字段名称
FHBaseUICombox.prototype.Name = null;

// 字段的值
FHBaseUICombox.prototype.Value = null;

// 列表高度
FHBaseUICombox.prototype.ListHeight = -1;

// 列表高度
FHBaseUICombox.prototype.Datas = null;

// 鼠标是否在面板上
FHBaseUICombox.prototype.isMouseOver = false;

// 当值发送改变时运行
FHBaseUICombox.prototype.on_change = function(strValuePre, strValueCurrent) {};

// 显示组件名称
FHBaseUICombox.prototype.alertName = function() {
	alert(this.Name);
};

/**
 * @描述：绘制列表
 * @开发人员：moshco zhu
 * @开发日期：2010-10-21 下午11:58:57
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICombox.prototype.paintList = function() {
	// 对象别名
	var oThis = this;
	// 列表对象
	var oList = this.Container.find(".FHBaseUIComboxList");
	// 清空值前的内容
	oList.empty();
	// 列表尺寸
	var iListWidth = oList.width();
	var iListHeight = oList.height();

	// 添加列表面板
	oList.append("<div />");
	var oListPanel = oList.find(">div:last-child");
	oListPanel.addClass("FHBaseUIComboxListPanel").css({
		position : "static",
		float : "left",
		width : (iListWidth - 2) + "px",
		clear : "both",
		border : "0px solid #333333"
	});

	// 添加每一行数据
	var iRowNum = (this.Datas == null) ? 0 : this.Datas.length;
	for ( var i = 0; i < iRowNum; i++) {
		oListPanel.append("<div />");
		var oOptionRow = oListPanel.find(">div:last-child");
		oOptionRow.addClass("FHBaseUIComboxListOption").css({
			position : "static",
			float : "left",
			width : (iListWidth - 2 - 5) + "px",
			height : "20px",
			"padding-left" : "5px",
			"line-height" : "20px",
			"white-space" : "nowrap",
			"overflow" : "hidden",
			clear : "both",
			border : "0px solid #333333"
		}).attr("index", i).html(this.Datas[i].text);
	}

	// 设置选项的背景
	oListPanel.find(".FHBaseUIComboxListOption").hover(function() {
		$(this).addClass("FHBaseUIComboxListOptionBg");
		return true;
	}, function() {
		$(this).removeClass("FHBaseUIComboxListOptionBg");
		return true;
	});

	// 选项的单击事件
	var fn_selectOption = function() {
		// 读取序号
		var iIndex = parseInt($(this).attr("index"));
		// 读取值
		var oOption = oThis.Datas[iIndex];
		// 设置input
		oThis.Container.find(".FHBaseUIComboxInput").val(oOption.text);
		oThis.Container.find(".FHBaseUIComboxInputValue").val(oOption.code);
		// 之前的值
		var strCode1 = oThis.Container.val();
		var strCode2 = oOption.code;
		// 设置组件值属性
		oThis.Container.val(strCode2);
		// 隐藏列表
		oThis.hideList();
		// 事件函数：当值发送改变时运行
		if (oThis.on_change != null) {
			var oOnChange = oThis.on_change;
			if ($.isFunction(oOnChange.charCodeAt)) {
				// 函数字符
				var fnOnChange = null;
				eval("fnOnChange = " + oOnChange + ";");
				fnOnChange(strCode1, strCode2);
			} else if ($.isFunction(oOnChange)) {
				// 是一个函数
				var fnOnChange = oOnChange;
				fnOnChange(strCode1, strCode2);
			}
		}
		return true;
	};
	oListPanel.find(".FHBaseUIComboxListOption").click(fn_selectOption);
};

/**
 * @描述:重新设置列表数据
 * @开发人员:moshco zhu
 * @开发时间:2011-6-11 下午01:12:51
 */
FHBaseUICombox.prototype.reSetDataList = function(oDataAry) {
	// 置空当前值
	this.Container.find(".FHBaseUIComboxInput").val("");
	this.Container.find(".FHBaseUIComboxInputValue").val("");
	// 设置值
	this.Datas = oDataAry;
	// 序列化保存
	this.serializeSave();
	// 清空列表值前的内容
	var oList = this.Container.find(".FHBaseUIComboxList");
	oList.empty();
};

/**
 * @描述:设置到合适高度
 * @开发人员:moshco zhu
 * @开发时间:2011-6-11 下午01:42:47
 * @param iMaxHeight
 */
FHBaseUICombox.prototype.setFitHeight = function(iMaxHeight) {
	var iRowNum = (this.Datas == null) ? 0 : this.Datas.length;
	var iHeight = 20 * iRowNum;
	if (iHeight > iMaxHeight) {
		iHeight = iMaxHeight;
	}
	this.ListHeight = iHeight;
	this.Container.find(".FHBaseUIComboxList").height(iHeight);
};

/**
 * @描述:选择值
 * @开发人员:moshco zhu
 * @开发时间:2011-6-11 下午02:02:23
 * @param strValue
 */
FHBaseUICombox.prototype.setValue = function(strValue) {
	if (this.Datas == null || this.Datas.length <= 0) {
		return false;
	}
	// 找寻值项
	var oOption = null;
	$.each(this.Datas, function(iIndex, oRow) {
		if (oRow.code + "" == strValue + "") {
			oOption = oRow;
			return false;
		}
		return true;
	});
	if (oOption != null) {
		// 设置input
		this.Container.find(".FHBaseUIComboxInput").val(oOption.text);
		this.Container.find(".FHBaseUIComboxInputValue").val(oOption.code);
		// 之前的值
		var strCode1 = this.Container.val();
		var strCode2 = oOption.code;
		// 设置组件值属性
		this.Container.val(strCode2);
		// 设置成功
		return true;
	}
	return false;
};

/**
 * @描述：显示列表
 * @开发人员：moshco zhu
 * @开发日期：2010-10-22 上午01:16:41
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICombox.prototype.showList = function() {
	// 对象别名
	var oThis = this;
	// 列表对象
	var oList = oThis.Container.find(".FHBaseUIComboxList");
	// 是否显示
	var strIsShow = oList.attr("is_show");
	if (strIsShow == "0") {
		// 显示
		oThis.paintList();
		oList.fadeIn(300, function() {});
		// 设置标识
		oList.attr("is_show", 1);
		// 更改图标按钮样式
		oThis.Container.find(".FHBaseUIComboxIconBtn").removeClass("FHBaseUIComboxListNoOpen").addClass("FHBaseUIComboxListOpen");
	}
};

/**
 * @描述：隐藏列表
 * @开发人员：moshco zhu
 * @开发日期：2010-10-22 上午01:16:25
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICombox.prototype.hideList = function() {
	// 对象别名
	var oThis = this;
	// 列表对象
	var oList = oThis.Container.find(".FHBaseUIComboxList");
	// 是否显示
	var strIsShow = oList.attr("is_show");
	if (strIsShow == "1") {
		// 隐藏
		oList.fadeOut(100, function() {
			$(this).empty();
		});
		// 设置标识
		oList.attr("is_show", 0);
		oThis.Container.find(".FHBaseUIComboxIconBtn").removeClass("FHBaseUIComboxListOpen").addClass("FHBaseUIComboxListNoOpen");
	}
};

/**
 * @描述：读取编码对应的文本
 * @开发人员：moshco zhu
 * @开发日期：2010-10-23 下午03:58:11
 * @参数：strValue
 * @返回值：any
 * @param strCode
 * @return
 */
FHBaseUICombox.prototype.getText = function(strCode) {
	var strText = null;
	var iLength = (this.Datas == null) ? 0 : this.Datas.length;
	for ( var i = 0; i < iLength; i++) {
		if (this.Datas[i].code == strCode) {
			strText = this.Datas[i].text;
			break;
		}
	}
	// 返回函数值
	return strText;
};

/**
 * @描述:序列化保存列表数据
 * @开发人员:moshco zhu
 * @开发时间:2011-6-11 下午01:36:27
 */
FHBaseUICombox.prototype.serializeSave = function() {
	// 值容器
	var oValueContainer = this.Container.find(">span");
	if (oValueContainer == null || oValueContainer.length == 0) {
		this.Container.append("<span />");
		oValueContainer = this.Container.find(">span:last-child");
		oValueContainer.css({
			display : "none"
		});
	}
	// 置空
	oValueContainer.empty();
	// 将值数组转换为值字符串
	var str = toStr(this.Datas, [
			",", "="
	]);
	// 赋值
	oValueContainer.text(str);
};

/**
 * @描述：初始化
 * @开发人员：moshco zhu
 * @开发日期：2010-10-21 下午10:51:12
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICombox.prototype.init = function() {
	// 对象别名
	var oThis = this;
	// 字段名称
	if (this.Name != null) {
		// 字段名称
		this.Container.attr("name", this.Name);
		this.Container.find(".FHBaseUIComboxInputValue").attr("name", this.Name);
		// 字段标题
		this.Container.find(".FHBaseUIComboxInput").attr("name", this.Name + "_text");
	}
	// 字段值
	if (this.Value != null) {
		this.Container.val(this.Value);
		this.Container.find(".FHBaseUIComboxInputValue").val(this.Value);
		var strText = this.getText(this.Value);
		this.Container.find(".FHBaseUIComboxInput").val((strText == null) ? "" : strText);
	}
	// 列表高度
	if (this.ListHeight != null) {
		this.Container.attr("list-height", this.ListHeight);
	}
	// 数据列表
	if (this.Datas != null) {
		this.serializeSave();
	}
	// 当值发送改变时运行
	if (this.on_change != null) {
		var oOnChange = this.on_change;
		if ($.isFunction(oOnChange.charCodeAt)) {
			// 字符串
			this.Container.attr("on-change", oOnChange);
		} else if ($.isFunction(oOnChange)) {
			// 是一个函数
			var strFunName = oOnChange.toString();
			this.Container.attr("on-change", strFunName);
		}
	}

	// 默认选择第一项
	if (this.Value == null || trim(this.Value) == "") {
		if (this.Datas != null && this.Datas.length > 0) {
			this.setValue(this.Datas[0].code);
		}
	}

	// 默认隐藏列表
	oThis.Container.find(".FHBaseUIComboxList").hide();
	oThis.hideList();

	// 显示或隐藏列表
	var fn = function() {
		// 列表对象
		var oList = oThis.Container.find(".FHBaseUIComboxList");
		// 是否显示
		var strIsShow = oList.attr("is_show");
		if (strIsShow == "0") {
			// 显示
			oThis.showList();
		} else if (strIsShow == "1") {
			// 隐藏
			oThis.hideList();
		}
		// 返回函数值
		return false;
	};
	// 显示或隐藏列表 设置输入框事件：失去焦点
	this.Container.find(".FHBaseUIComboxInput").unbind().click(fn).blur(function() {
		if (!oThis.isMouseOver) {
			oThis.hideList();
		}
		return true;
	});

	// 设置图标按钮事件：单击
	this.Container.find(".FHBaseUIComboxIconBtn").unbind().click(function() {
		// 显示
		oThis.showList();
		oThis.Container.find(".FHBaseUIComboxInput").focus();
		return true;
	});

	// 设置容器事件
	this.Container.unbind().mouseover(function() {
		oThis.isMouseOver = true;
		return false;
	}).mouseout(function() {
		oThis.isMouseOver = false;
		return false;
	}).click(function() {
		oThis.Container.find(".FHBaseUIComboxInput").focus();
		return false;
	});

};

/**
 * @描述：绘制
 * @开发人员：moshco zhu
 * @开发日期：2010-10-21 下午10:50:48
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICombox.prototype.paint = function() {
	// 容器对象
	var oContainer = this.Container;
	// 设置容器样式
	oContainer.addClass("FHBaseUICombox");

	// 读取容器尺寸
	var iWidth = oContainer.width();
	var iHeight = oContainer.height();

	// 创建第一行
	oContainer.append("<div />");
	var oRow1 = oContainer.find(">div:last-child");
	oRow1.addClass("FHBaseUIComboxRow1").css({
		position : "static",
		float : "left",
		width : (iWidth - 2) + "px",
		height : (iHeight - 2) + "px",
		overflow : "hidden",
		clear : "both"
	});

	// 图标按钮宽度比高度少几个像数
	var iLa = -4;

	// 创建Input Div
	oRow1.append("<div />");
	var oInputContainer = oRow1.find(">div:last-child");
	oInputContainer.addClass("FHBaseUIComboxInputContainer").css({
		position : "static",
		float : "left",
		width : (iWidth - 2 - (iHeight - 2 - iLa)) + "px",
		height : (iHeight - 2) + "px",
		overflow : "hidden"
	});

	// 创建一个Input 的
	oInputContainer.append("<input type=\"text\" />");
	var oInput = oInputContainer.find(">input:last-child");
	oInput.addClass("FHBaseUIComboxInput").css({
		position : "static",
		float : "left",
		width : (iWidth - 22 - 3) + "px",
		height : (iHeight - 2) + "px",
		"line-height" : (iHeight - 2) + "px",
		"padding-left" : "3px",
		border : "0px solid #333333"
	}).attr("readonly", "1");

	// 创建图标按钮
	oRow1.append("<div />");
	var oIconButton = oRow1.find(">div:last-child");
	oIconButton.addClass("FHBaseUIComboxIconBtn").addClass("FHBaseUIComboxListNoOpen").css({
		position : "static",
		float : "left",
		width : (iHeight - 2 - iLa) + "px",
		height : (iHeight - 2) + "px",
		overflow : "hidden"
	});

	// 创建第二行
	oContainer.append("<div />");
	var oRow2 = oContainer.find(">div:last-child");
	oRow2.addClass("FHBaseUIComboxRow2").css({
		position : "static",
		float : "left",
		width : iWidth + "px",
		height : "0px",
		clear : "both",
		overflow : "hidden",
		border : "0px solid #333333"
	});

	// 下拉列表
	oRow2.append("<div />");
	var oList = oRow2.find(">div:last-child");
	oList.addClass("FHBaseUIComboxList").css({
		position : "absolute",
		float : "left",
		width : (iWidth - 2) + "px",
		height : this.ListHeight + "px",
		"margin-top" : "-1px",
		clear : "both",
		"overflow-x" : "hidden",
		"overflow-y" : "auto"
	}).attr("is_show", "0").hide();

	// 创建第三行
	oContainer.append("<div />");
	var oRow3 = oContainer.find(">div:last-child");
	oRow3.addClass("FHBaseUIComboxRow3").css({
		position : "static",
		float : "left",
		width : iWidth + "px",
		height : "0px",
		clear : "both",
		overflow : "hidden",
		border : "0px solid #333333"
	});
	// 添加值字段
	oRow3.append("<input type=\"hidden\" />");
	var oInputValue = oRow3.find(">input:last-child");
	oInputValue.addClass("FHBaseUIComboxInputValue");
};

/**
 * @描述：递归选择器
 * @开发人员：moshco zhu
 * @开发日期：2010-11-13 下午07:02:20
 * @参数：oContainer, oParam
 * @返回值：any
 * @param oTarget
 * @param oParam
 * @return
 */
function FHBaseUIRecurSelector(oTarget, oParam) {
	// 扩展基础组件对象
	var oComponentClass = {};
	$.extend(oComponentClass, FHBase);
	$.extend(oComponentClass, FHBaseUIRecurSelector);
	$.extend(FHBaseUIRecurSelector, oComponentClass);
	var oComponent = {};
	$.extend(oComponent, FHBASE);
	$.extend(oComponent, this);
	$.extend(this, oComponent);
	// 目标对象
	this.Target = oTarget;
	if (oParam == null) {
		// 标题
		var strTitle = oTarget.attr("tl");
		this.Title = strTitle;
		// 参数在目标对象div上
		var strDataUrl = oTarget.attr("data_url");
		this.DataUrl = strDataUrl;
		// 是否默认关闭面板
		var strIsDefaultClosePanel = oTarget.attr("is_default_close_panel");
		if (strIsDefaultClosePanel != null) {
			this.isDefaultClosePanel = true;
		}
		// 回调函数
		var strOnSelected = oTarget.attr("on_selected");
		if (strOnSelected != null && strOnSelected != "") {
			this.OnSelected = strOnSelected;
		}
		// 选择项映射规则
		var strMapping = oTarget.attr("mapping");
		if (strMapping != null && strMapping != "") {
			this.Mapping = strMapping;
		}
	} else {
		// 参数对象
	}
};

// 中间内容的Padding值
FHBaseUIRecurSelector.prototype.MidContentPadding = 10;

// 目标对象
FHBaseUIRecurSelector.prototype.Target = null;

// 容器对象
FHBaseUIRecurSelector.prototype.Container = null;

// 标题
FHBaseUIRecurSelector.prototype.Title = null;

// 数据Url
FHBaseUIRecurSelector.prototype.DataUrl = null;

// 是否默认关闭面板
FHBaseUIRecurSelector.prototype.isDefaultClosePanel = false;

// 选择项数据
FHBaseUIRecurSelector.prototype.OptionDatas = null;

// 选择项映射规则
FHBaseUIRecurSelector.prototype.Mapping = null;

// 事件函数：当选择后运行
FHBaseUIRecurSelector.prototype.OnSelected = null;

// 鼠标是否在面板上
FHBaseUIRecurSelector.prototype.isMouseOver = false;

/**
 * @描述：读取选项的明细数据
 * @开发人员：moshco zhu
 * @开发日期：2010-11-15 下午03:02:08
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIRecurSelector.prototype.getOptionDetailDatas = function(strParentCodes) {
	// 对象别名
	var oThis = this;
	// 读取数据
	if (this.OptionDatas == null) {
		// 异步函数
		var fn = function(strJs) {
			try {
				// 转换为有效的Js字符串
				var oOptionDatas = null;
				eval("oOptionDatas = " + strJs + ";");
				if (oOptionDatas != null) {
					oThis.OptionDatas = oOptionDatas;
				}
			} catch (e) {
				// alert(strJs);
				alert("读取数据出错！");
			}
		};
		// 发出请求
		doAction(this.DataUrl, null, fn, false);
	}

	// 读取指定级别的选项
	var oOptions = this.OptionDatas;
	if (strParentCodes != null && strParentCodes != "") {
		// 置空
		oOptions = null;
		// 将上级编码分解
		var oParentCodes = strParentCodes.split(",");
		// 递归查询
		var fn_iterate = function(oOptionDatas, oParentCodes, iAryIndex) {
			// 匹配找寻
			var oOption = null;
			$.each(oOptionDatas, function(iIndex, oMOption) {
				if (oMOption.code == oParentCodes[iAryIndex]) {
					oOption = oMOption;
					return false;
				}
				return true;
			});
			// 返回函数值
			if (oOption.options != null) {
				// 继续向下查询 或返回
				if (iAryIndex == oParentCodes.length - 1) {
					return oOption.options;
				} else {
					return fn_iterate(oOption.options, oParentCodes, ++iAryIndex);
				}
			} else {
				return null;
			}
		};

		// 读取选择项数组
		oOptions = fn_iterate(this.OptionDatas, oParentCodes, 0);
	}

	// 返回函数值
	return oOptions;
};

/**
 * @描述：读取选项数组
 * @开发人员：moshco zhu
 * @开发日期：2010-11-19 上午02:09:47
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIRecurSelector.prototype.getOptionArray = function(strCodes) {
	// 选项数组
	var oOptions = new Array();
	// 将编码分解
	var aryCodes = strCodes.split(",");
	// 递归查询
	var fn_iterate = function(oOptionDatas, aryCodes, iAryIndex) {
		// 匹配找寻
		var oOption = null;
		$.each(oOptionDatas, function(iIndex, oMOption) {
			if (oMOption.code == aryCodes[iAryIndex]) {
				oOption = oMOption;
				oOptions.push(oOption);
				return false;
			}
			return true;
		});
		// 返回函数值
		if (oOption.options != null) {
			// 继续向下查询 或返回
			if (iAryIndex == aryCodes.length - 1) {
				return;
			} else {
				fn_iterate(oOption.options, aryCodes, ++iAryIndex);
			}
		} else {
			return;
		}
	};

	// 读取选择项数组
	fn_iterate(this.OptionDatas, aryCodes, 0);

	// 返回函数值
	return oOptions;
};

/**
 * @描述：显示指定项的明细(绘制它的下级明细的数据面板)
 * @开发人员：moshco zhu
 * @开发时间：2011-6-12 下午11:14:08
 */
FHBaseUIRecurSelector.prototype.showOptionDetail = function(strParentCodes, strParentTexts, bIsInitEvent) {

	// 明细数据面板
	var oDataPanel = null;

	// 分解各级编码
	var straCode = [];
	var iLevel = -1;
	if (strParentCodes != null && strParentCodes != "") {
		straCode = strParentCodes.split(",");
		iLevel = straCode.length - 1;
	}

	// 中部内容
	var oRowMidContent = this.Container.find(".FHBaseUIRecurSelectorMidContent");

	// 数据面板
	var oDataPanels = oRowMidContent.find(".FHBaseUIRecurSelectorDataPanel");
	// 删除子集选项的数据面板
	oDataPanels.each(function() {
		var strLevel = $(this).attr("level");
		if ((strLevel != null) && (parseInt(strLevel) > iLevel)) {
			$(this).remove();
		}
	});

	// 间隔行
	var oIntervalRows = oRowMidContent.find(".FHBaseUIRecurSelectorDataPanelInterval").each(function() {
		var strLevel = $(this).attr("level");
		if ((strLevel != null) && (parseInt(strLevel) > iLevel)) {
			$(this).remove();
		}
	});

	// 删除工具面板
	var oBtnToolbar = this.Container.find(".FHBaseUIRecurSelectorButtonToolBar");
	if (oBtnToolbar.length > 0) {
		oBtnToolbar.remove();
	}

	// 读取数据
	var oOptionDetailDatas = this.getOptionDetailDatas(strParentCodes);
	if (oOptionDetailDatas != null) {
		// 绘制下一级选项的数据面板
		// 内容部分的尺寸
		var iContentWidth = oRowMidContent.width();

		// 添加一个间隔行
		if (oDataPanels.length > 0) {
			// 间隔行
			oRowMidContent.append("<div />");
			var oIntervalRow = oRowMidContent.find(">div:last-child");
			oIntervalRow.addClass("FHBaseUIRecurSelectorDataPanelInterval").css({
				position : "static",
				float : "left",
				width : iContentWidth + "px",
				overflow : "hidden",
				clear : "both"
			});
			// 设置间隔行的深度属性
			oIntervalRow.attr("level", (iLevel + 1));
		}

		// 数据面板区域
		oRowMidContent.append("<div />");
		oDataPanel = oRowMidContent.find(">div:last-child");

		// 设置数据面板的深度属性
		oDataPanel.attr("level", (iLevel + 1));
		// 设置格子的上级编码 上级标题
		oDataPanel.attr("parent_code", (strParentCodes == null) ? "" : strParentCodes);
		oDataPanel.attr("parent_text", (strParentTexts == null) ? "" : strParentTexts);
		// 设置样式
		oDataPanel.addClass("FHBaseUIRecurSelectorDataPanel").css({
			position : "static",
			float : "left",
			"padding-top" : "5px",
			"padding-bottom" : "5px",
			"padding-left" : "2px",
			"padding-right" : "2px",
			width : (iContentWidth - 6) + "px",
			overflow : "hidden",
			clear : "both"
		});

		// 绘制数据格子
		var iLength = (oOptionDetailDatas == null) ? 0 : oOptionDetailDatas.length;
		for ( var i = 0; i < iLength; i++) {
			// 数据格子
			oDataPanel.append("<div />");
			var oCell = oDataPanel.find(">div:last-child");
			// 设置样式
			oCell.addClass("FHBaseUIRecurSelectorOptionCell");
			oCell.addClass("FHBaseUIRecurSelectorOptionCell1");
			oCell.css({
				position : "static",
				float : "left"
			});
			// 设置文本
			oCell.html(oOptionDetailDatas[i].title);
			oCell.attr("text", oOptionDetailDatas[i].title);
			// 设置编码
			oCell.attr("code", oOptionDetailDatas[i].code);
			// 设置标签
			oCell.attr("title", oOptionDetailDatas[i].code);
			// 是否有子选项
			oCell.attr("is_leaf", (oOptionDetailDatas[i].options == null) ? "1" : "0");
		}
	}

	// 添加工具面板
	if (oBtnToolbar.length > 0) {
		oRowMidContent.append(oBtnToolbar);
	}

	// 设置中间部分的高度到合适的尺寸
	this.setMidFitSize();

	// 设置到合适位置
	this.setFitPosition();

	// 设置事件
	if ((bIsInitEvent == null) || (bIsInitEvent)) {
		this.initDataPanelEvent();
	}

	// 返回函数值
	return oDataPanel;
};

/**
 * @描述：初始化数据
 * @开发人员：moshco zhu
 * @开发日期：2010-11-15 上午09:25:06
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIRecurSelector.prototype.initData = function() {
	// 对象别名
	var oThis = this;

	// 中间内容部分
	var oRowMidContent = this.Container.find(".FHBaseUIRecurSelectorMidContent");
	// 清空原有的内容
	oRowMidContent.empty();

	// 内容部分的尺寸
	var iContentWidth = oRowMidContent.width();

	// 标题
	oRowMidContent.append("<div />");
	var oTitle = oRowMidContent.find(">div:last-child");
	// 设置样式
	oTitle.addClass("FHBaseUIRecurSelectorTitle").css({
		position : "static",
		float : "left",
		width : iContentWidth + "px",
		overflow : "hidden",
		clear : "both"
	});
	if (this.Title != null && this.Title != "") {
		oTitle.html(this.Title);
	} else {
		oTitle.html("&nbsp;");
		oTitle.height(1);
	}

	// 显示某一项明细
	this.showOptionDetail(null, null, false);

	// 按钮工具条
	oRowMidContent.append("<div />");
	var oButtonToolBar = oRowMidContent.find(">div:last-child");
	// 设置样式
	oButtonToolBar.addClass("FHBaseUIRecurSelectorButtonToolBar").css({
		position : "static",
		float : "left",
		width : iContentWidth + "px",
		overflow : "hidden",
		clear : "both"
	});

	// 关闭按钮
	oButtonToolBar.append("<div />");
	var oCloseButton = oButtonToolBar.find(">div:last-child");
	// 设置样式
	oCloseButton.addClass("FHBaseUIRecurSelectorBtnClose");
	oCloseButton.addClass("FHBaseUIRecurSelectorBtnClose1");
	oCloseButton.css({
		position : "static",
		float : "right",
		"margin-right" : "20px"
	});

	// 设置中间部分的高度到合适的尺寸
	this.setMidFitSize();
};

/**
 * @描述：设置中间到合适的尺寸
 * @开发人员：moshco zhu
 * @开发日期：2010-11-15 下午01:43:21
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIRecurSelector.prototype.setMidFitSize = function() {
	// 中间总计高度
	var iMidTotalHeight = 0;
	// 标题的高度
	this.Container.find(".FHBaseUIRecurSelectorTitle").each(function() {
		iMidTotalHeight += $(this).outerHeight();
	});
	// 间隔行高度
	this.Container.find(".FHBaseUIRecurSelectorDataPanelInterval").each(function() {
		iMidTotalHeight += $(this).outerHeight();
	});
	// 数据面板的实际高度
	this.Container.find(".FHBaseUIRecurSelectorDataPanel").each(function() {
		iMidTotalHeight += $(this).outerHeight();
	});
	// 工具按钮条的高度
	var oButtonToolBar = this.Container.find(".FHBaseUIRecurSelectorButtonToolBar");
	iMidTotalHeight += oButtonToolBar.outerHeight();
	// 中间内容的Padding值
	iMidTotalHeight += this.MidContentPadding;
	// 中间部分
	var oMidRow = this.Container.find(".FHBaseUIRecurSelectorMid");
	oMidRow.height(iMidTotalHeight);
	// 中间 内容
	var oRowMidContent = this.Container.find(".FHBaseUIRecurSelectorMidContent");
	oRowMidContent.height(iMidTotalHeight - this.MidContentPadding);
	// 中间 左边 右边
	oMidRow.find(".FHBaseUIRecurSelectorMidLeft").height(iMidTotalHeight);
	oMidRow.find(".FHBaseUIRecurSelectorMidRight").height(iMidTotalHeight);

	// 容器的高度
	var iContainerHeight = iMidTotalHeight;
	iContainerHeight += this.Container.find(".FHBaseUIRecurSelectorTop").outerHeight();
	iContainerHeight += this.Container.find(".FHBaseUIRecurSelectorBottom").outerHeight();
	this.Container.attr("height1", iContainerHeight);
	this.Container.css("height", iContainerHeight);
};

/**
 * @描述：初始化数据面板的事件
 * @开发人员：moshco zhu
 * @开发日期：2010-11-15 下午03:25:30
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIRecurSelector.prototype.initDataPanelEvent = function() {
	// 对象别名
	var oThis = this;

	// 关闭按钮
	var oBtnClose = this.Container.find(".FHBaseUIRecurSelectorBtnClose");
	// 关闭按钮事件：鼠标移入 移出
	oBtnClose.unbind().hover(function() {
		var oBtnClose = oThis.Container.find(".FHBaseUIRecurSelectorBtnClose");
		oBtnClose.removeClass("FHBaseUIRecurSelectorBtnClose1");
		oBtnClose.addClass("FHBaseUIRecurSelectorBtnClose2");
		return true;
	}, function() {
		var oBtnClose = oThis.Container.find(".FHBaseUIRecurSelectorBtnClose");
		oBtnClose.removeClass("FHBaseUIRecurSelectorBtnClose2");
		oBtnClose.addClass("FHBaseUIRecurSelectorBtnClose1");
		return true;
	});
	// 关闭按钮事件：单击事件
	oBtnClose.click(function() {
		oThis.Container.hide();
		return false;
	});

	// 每一个选项事件：鼠标移入 移出
	this.Container.find(".FHBaseUIRecurSelectorOptionCell").unbind().hover(function() {
		var strIsSelected = $(this).attr("is_selected");
		strIsSelected = (strIsSelected == null || strIsSelected == "") ? "0" : strIsSelected;
		if (strIsSelected == "0") {
			$(this).removeClass("FHBaseUIRecurSelectorOptionCell1");
			$(this).addClass("FHBaseUIRecurSelectorOptionCell2");
		}
		return true;
	}, function() {
		var strIsSelected = $(this).attr("is_selected");
		strIsSelected = (strIsSelected == null || strIsSelected == "") ? "0" : strIsSelected;
		if (strIsSelected == "0") {
			$(this).removeClass("FHBaseUIRecurSelectorOptionCell2");
			$(this).addClass("FHBaseUIRecurSelectorOptionCell1");
		}
		return true;
	});

	// 每一个选项事件：选择指定项
	var fn_select_cell = function(oDataPanel, strCode) {
		oThis.selectCell(oDataPanel, strCode);
	};
	// 每一个选项事件：显示下级项明细
	var fn_show_detail_options = function(oDataPanel, strCode, strText) {
		// 当前项上级编码 文本
		var strParentCode = oDataPanel.attr("parent_code");
		var strParentText = oDataPanel.attr("parent_text");
		// 显示下级明细项
		var strParentCodes = ((strParentCode == null || strParentCode == "") ? "" : (strParentCode + ",")) + strCode;
		var strParentTexts = ((strParentText == null || strParentText == "") ? "" : (strParentText + " ")) + strText;
		// 显示下级明显项
		oThis.showOptionDetail(strParentCodes, strParentTexts);
	};
	// 每一个选项事件：运行事件函数
	var fn_run_event = function(oDataPanel, strCode) {
		// 事件函数名
		if (oThis.OnSelected == null || trim(oThis.OnSelected) == "") {
			return;
		}
		// 事件函数
		var fn_OnSelected = null;
		eval("fn_OnSelected = " + oThis.OnSelected);
		if (fn_OnSelected == null) {
			return;
		}
		// 当前项上级编码
		var strParentCode = oDataPanel.attr("parent_code");
		// 编码串
		var strCodes = ((strParentCode == null || strParentCode == "") ? "" : (strParentCode + ",")) + strCode;
		// 读取所有选项数组
		var oOptions = oThis.getOptionArray(strCodes);
		// 事件函数
		var bIsSet = fn_OnSelected(oOptions);
		// 返回函数值
		return bIsSet;
	};
	// 每一个选项事件：设置值
	var fn_set_value = function(oDataPanel, oOption) {
		// 当前项上级编码 文本
		var strParentCode = oDataPanel.attr("parent_code");
		var strParentText = oDataPanel.attr("parent_text");
		// 当前项编码 文本
		var strCode = oOption.attr("code");
		var strText = oOption.attr("text");
		// 编码串 文本串
		var strCodes = ((strParentCode == null || strParentCode == "") ? "" : (strParentCode + ",")) + strCode;
		var strTexts = ((strParentText == null || strParentText == "") ? "" : (strParentText + " ")) + strText;
		// 设置目标对象的值
		oThis.Target.val(strTexts);
		oThis.Target.attr("text", strText);
		oThis.Target.attr("texts", strTexts);
		oThis.Target.attr("code", strCode);
		oThis.Target.attr("codes", strCodes);
		// 设置映射字段的值
		if (oThis.Mapping != null) {
			var oMapping = null;
			eval("oMapping = " + oThis.Mapping + ";");
			var iLength = (oMapping == null) ? 0 : oMapping.length;
			var aryCodes = null;
			var aryTexts = null;
			if (iLength > 0) {
				aryCodes = strCodes.split(",");
				aryTexts = strTexts.split(" ");
			}
			var oForm = oThis.Target.parents("form");
			if (oForm == null || oForm.length == 0) {
				oForm = $(window.document.body);
			}
			for ( var i = 0; i < iLength; i++) {
				// 映射Code字段
				if (oMapping[i].code != null && aryCodes.length > i) {
					oForm.find("[name=" + oMapping[i].code + "]").val(aryCodes[i]);
				}
				// 映射文本字段
				if (oMapping[i].text != null && aryTexts.length > i) {
					oForm.find("[name=" + oMapping[i].text + "]").val(aryTexts[i]);
				}
			}
		}
	};
	// 每一个选项事件：单击事件
	this.Container.find(".FHBaseUIRecurSelectorOptionCell").click(function() {
		// 格子
		var oOption = $(this);
		// 数据面板
		var oDataPanel = oOption.parents(".FHBaseUIRecurSelectorDataPanel");
		// 选项编码 文本
		var strCode = oOption.attr("code");
		var strText = oOption.attr("text");
		// 是否是叶子
		var strIsLeaf = oOption.attr("is_leaf");
		// 选择指定格子
		fn_select_cell(oDataPanel, strCode);
		// 显示下级明细
		fn_show_detail_options(oDataPanel, strCode, strText);
		// 运行事件函数
		var bIsSet = fn_run_event(oDataPanel, strCode);
		// 设置值
		if ((bIsSet == null || bIsSet) && (strIsLeaf == "1")) {
			fn_set_value(oDataPanel, oOption);
			// 隐藏面板
			if (oThis.isDefaultClosePanel) {
				oThis.Container.hide(300);
			}
		}

		// 返回函数值
		return true;
	});
};

/**
 * @描述：通过编码找寻对应的编码串
 * @开发人员：moshco zhu
 * @开发日期：2010-11-22 下午11:32:35
 * @参数：strCode
 * @返回值：any
 * @param strCode
 * @return
 */
FHBaseUIRecurSelector.prototype.getCodes = function(strCode) {
	// 读取数据
	var oOptions = this.getOptionDetailDatas(null);
	// 函数：递归查询
	var fn_recur = function(ary, str) {
		// 数组不能为空
		if (ary == null || ary.length == 0) {
			return null;
		}
		// 循环查询
		var strf = null;
		$.each(ary, function(iIndex, oOption) {
			if (oOption.options == null) {
				// 叶子 匹配
				if (str == oOption.code) {
					strf = oOption.code;
					return false;
				}
			} else {
				// 枝干 向下递归
				var str1 = fn_recur(oOption.options, str);
				if (str1 != null) {
					strf = oOption.code + "," + str1;
					return false;
				}
			}
			return true;
		});
		// 返回函数值
		return strf;
	};
	// 开始递归查询
	var strCodes = fn_recur(oOptions, strCode);
	// 返回函数值
	return strCodes;
};

/**
 * @描述：在数据面板中选择指定的格子
 * @开发人员：moshco zhu
 * @开发日期：2010-11-23 上午12:50:06
 * @参数：oDataPanel, strCode
 * @返回值：any
 * @param oDataPanel
 * @param strCode
 * @return
 */
FHBaseUIRecurSelector.prototype.selectCell = function(oDataPanel, strCode) {
	// 找寻编码对应的格子
	var oAllCell = oDataPanel.find(".FHBaseUIRecurSelectorOptionCell");
	// 取消所有格子处于选择状态
	oAllCell.removeClass("FHBaseUIRecurSelectorOptionCell2");
	oAllCell.removeClass("FHBaseUIRecurSelectorOptionCell3");
	oAllCell.addClass("FHBaseUIRecurSelectorOptionCell1");
	oAllCell.attr("is_selected", "0");
	// 设置指定的格子被选择
	oAllCell.each(function() {
		if ($(this).attr("code") == strCode) {
			// 设置为选择状态
			$(this).addClass("FHBaseUIRecurSelectorOptionCell3").attr("is_selected", "1");
		}
	});
};

/**
 * @描述：显示默认值
 * @开发人员：moshco zhu
 * @开发日期：2010-11-22 下午10:20:31
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIRecurSelector.prototype.showDefaultValue = function() {
	// 对象别名
	var oThis = this;

	// 读取当前默认值编码串
	var strCodes = this.Target.attr("codes");
	if (strCodes == null || trim(strCodes) == "") {
		// 编码
		var strCode = this.Target.attr("code");
		// 找寻对应的编码串
		strCodes = this.getCodes(strCode);
		// 设置目标对象的编码串
		if (strCodes != null) {
			this.Target.attr("codes", strCodes);
		}
	}

	// 选择默认值
	if (strCodes != null && trim(strCodes) != "") {
		// 分解编码
		var aryCode = strCodes.split(",");
		// 逐层向下找寻
		var iLength = (aryCode == null) ? 0 : aryCode.length;
		var strParentCodes = "";// 上级编码串
		// 中部内容
		var oRowMidContent = this.Container.find(".FHBaseUIRecurSelectorMidContent");
		for ( var i = 0; i < iLength; i++) {
			// 找寻面板对象
			var oDataPanels = oRowMidContent.find(".FHBaseUIRecurSelectorDataPanel");
			var bIsFindDataPanel = false;// 是否找到数据面板
			oDataPanels.each(function() {
				var str = $(this).attr("parent_code");
				if (str == strParentCodes) {
					// 选择指定编码的格子
					oThis.selectCell($(this), aryCode[i]);
					// 找到数据面板
					bIsFindDataPanel = true;
				}
				return !bIsFindDataPanel;
			});

			// 绘制数据面板
			if (!bIsFindDataPanel) {
				var oDataPanel = this.showOptionDetail(strParentCodes);
				this.selectCell(oDataPanel, aryCode[i]);
			}

			// 连接上级编码串
			if (i > 0) {
				strParentCodes += ",";
			}
			strParentCodes += aryCode[i];
		}
	}
};

/**
 * @描述：设置容器到合适位置
 * @开发人员：moshco zhu
 * @开发时间：2011-6-10 下午11:02:09
 */
FHBaseUIRecurSelector.prototype.setFitPosition = function() {
	// 目标对象
	var oTarget = this.Target;
	var iTargetHeight = oTarget.outerHeight();
	// 读取目标对象的位置
	var oOffset = oTarget.offset();// position offset
	var iLeft = oOffset.left;
	var iTop = oOffset.top + iTargetHeight;
	var it1 = iTop;
	var oRowTopMidArrow = this.Container.find(".FHBaseUIRecurSelectorTopArrow");
	iTop += oRowTopMidArrow.outerHeight();
	var iScollTop = $(window.document.body).scrollTop();
	//iTop += iScollTop;
	if (iTop + this.Container.outerHeight() > $(window.document.body).height()) {
		iTop = $(window.document.body).height() - this.Container.outerHeight();
	}
	if (iLeft + this.Container.outerWidth() > $(window.document.body).width()) {
		iLeft = $(window.document.body).width() - this.Container.outerWidth();
	}
	//alert("1:" + it1 + " 2:" + iTop + " sc:" + iScollTop);
	this.Container.css({
		"margin-left" : "0px",
		"margin-top" : "0px",
		left : parseInt(iLeft) + "px",
		top : parseInt(iTop) + "px"
	});
	// 返回函数值
	return false;
};

/**
 * @描述：初始化
 * @开发人员：moshco zhu
 * @开发日期：2010-11-13 下午07:27:25
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIRecurSelector.prototype.init = function() {
	// 对象别名
	var oThis = this;

	// 标题
	if (this.Title != null) {
		this.Target.attr("tl", this.Title);
	}
	// 数据源Url
	if (this.DataUrl != null) {
		this.Target.attr("data_url", this.DataUrl);
	}
	// 是否默认关闭面板
	if (this.isDefaultClosePanel != null && this.isDefaultClosePanel) {
		this.Target.attr("is_default_close_panel", "true");
	}
	// 映射规则
	if (this.Mapping != null) {
		this.Target.attr("mapping", this.Mapping);
	}
	// 回调函数
	if (this.OnSelected != null) {
		this.Target.attr("on_selected", this.OnSelected);
	}

	// 确定容器
	if (this.Container == null) {
		var strCode = this.Target.attr(FHBaseUIRecurSelector.TARGET_ATTR_NAME_CODE);
		var str = "div[" + FHBaseUIRecurSelector.ATTR_NAME_CODE + "=" + strCode + "]";
		$(window.document.body).find(str).each(function() {
			if ($(this).hasClass("FHBaseUIRecurSelector")) {
				oThis.Container = $(this);
			}
		});
		this.Container.show();
	}

	// 初始化显示数据
	this.initData();

	// 显示容器面板
	var fn_show = function() {
		// 显示容器
		oThis.Container.show(300, function() {
			// 设置中间合适尺寸
			oThis.setMidFitSize();
			// 设置组件到合适坐标
			oThis.setFitPosition();
		});
		// 设置默认值
		oThis.showDefaultValue();
		// 读取最大的z-index属性
		var iZIndex = 0;
		$(".FHBaseUIRecurSelector").each(function() {
			var strZIndex = $(this).css("z-index");
			if (strZIndex != null) {
				if (parseInt(strZIndex) >= iZIndex) {
					iZIndex = parseInt(strZIndex) + 1;
				}
			}
		});
		// 设置Z-Index属性
		oThis.Container.css({
			"z-index" : iZIndex
		});
	};
	// 隐藏面板
	var fn_hide = function() {
		if (!oThis.isMouseOver) {
			oThis.Container.hide(300);
		}
		return true;
	};

	// 设置目标组件的单击事件 单击时显示 失去焦点时隐藏
	// this.Target.click(fn_show).focus(fn_show);
	this.Target.unbind().click(fn_show).blur(fn_hide);
	// oThis.Container.hide(300);

	// 容器事件
	this.Container.unbind().click(function() {
		oThis.Target.focus();
		return false;
	}).mouseover(function() {
		oThis.isMouseOver = true;
		return false;
	}).mouseout(function() {
		oThis.isMouseOver = false;
	});

	// 初始化数据面板的事件
	this.initDataPanelEvent();

	// 将组件隐藏
	this.Container.hide();
	var iWidth1 = this.Container.attr("width1");
	var iHeight1 = this.Container.attr("height1");
	this.Container.css({
		width : iWidth1 + "px",
		height : iHeight1 + "px",
		overflow : ""
	});
};

/**
 * @描述：绘制对象
 * @开发人员：moshco zhu
 * @开发日期：2010-11-13 下午07:26:42
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIRecurSelector.prototype.paint = function() {

	// 目标对象
	var oTarget = this.Target;

	// 读取一个8位长的随机数
	var strCode = random(8);
	// 设置目标组件关连的选择器组件的编码
	oTarget.attr(FHBaseUIRecurSelector.TARGET_ATTR_NAME_CODE, strCode);
	// 读取目标对象的高度
	var iTargetHeight = oTarget.outerHeight();
	// 读取目标对象的位置
	var oOffset = oTarget.offset();
	var iLeft = oOffset.left;
	var iTop = oOffset.top + iTargetHeight;
	// Body对象
	var oBody = $(window.document.body);

	// 绘制一个层对象
	oBody.append("<div />");
	var oContainer = oBody.find(">div:last-child");
	this.Container = oContainer;// 容器对象
	oContainer.addClass("FHBaseUIRecurSelector").css({
		position : "absolute",
		left : iLeft + "px",
		"z-index" : 0
	});
	// 设置编码属性
	oContainer.attr(FHBaseUIRecurSelector.ATTR_NAME_CODE, strCode);

	// 读取容器的尺寸
	var iWidth = oContainer.width();
	var iHeight = oContainer.height();
	oContainer.css({
		width : "0px",
		height : "0px",
		overflow : "hidden"
	}).attr("width1", iWidth).attr("height1", iHeight);

	// 绘制第一行
	oContainer.append("<div />");
	var oRowTop = oContainer.find(">div:last-child");
	// 设置样式
	oRowTop.addClass("FHBaseUIRecurSelectorTop").css({
		position : "static",
		float : "left",
		width : iWidth + "px",
		clear : "both",
		overflow : "hidden"
	});
	// 读取高度
	var iRowBorderTopHeight = oRowTop.height();

	// 顶部 左
	oRowTop.append("<div />");
	var oRowTopLeft = oRowTop.find(">div:last-child");
	// 设置样式
	oRowTopLeft.addClass("FHBaseUIRecurSelectorTopLeft").css({
		position : "static",
		float : "left",
		height : iRowBorderTopHeight + "px",
		overflow : "hidden"
	});
	// 左边宽 度
	var iTopLeftWidth = oRowTopLeft.outerWidth();

	// 顶部 中
	oRowTop.append("<div />");
	var oRowTopMid = oRowTop.find(">div:last-child");
	// 设置样式
	oRowTopMid.addClass("FHBaseUIRecurSelectorTopMid").css({
		position : "static",
		float : "left",
		height : iRowBorderTopHeight + "px",
		overflow : "hidden"
	});

	// 顶部 右
	oRowTop.append("<div />");
	var oRowTopRight = oRowTop.find(">div:last-child");
	// 设置样式
	oRowTopRight.addClass("FHBaseUIRecurSelectorTopRight").css({
		position : "static",
		float : "right",
		height : iRowBorderTopHeight + "px",
		overflow : "hidden"
	});
	// 右边宽度
	var iTopRightWidth = oRowTopRight.outerWidth();

	// 顶部 设置中间的宽度
	oRowTopMid.css({
		width : (iWidth - iTopLeftWidth - iTopRightWidth) + "px"
	});

	// 添加箭头
	oRowTopMid.append("<div />");
	var oRowTopMidArrow = oRowTopMid.find(">div:last-child");
	// 设置样式
	oRowTopMidArrow.addClass("FHBaseUIRecurSelectorTopArrow").css({
		position : "absolute",
		overflow : "hidden"
	});

	// 设置容器偏移
	iTop += oRowTopMidArrow.outerHeight();
	oContainer.css({
		top : iTop + "px"
	});

	// 绘制第二行
	oContainer.append("<div />");
	var oRowMid = oContainer.find(">div:last-child");
	// 设置样式
	oRowMid.addClass("FHBaseUIRecurSelectorMid").css({
		position : "static",
		float : "left",
		width : iWidth + "px",
		clear : "both"
	});
	// 第二行行高
	var iRowMidHeight = oRowMid.outerHeight();

	// 中间 左
	oRowMid.append("<div />");
	var oRowMidLeft = oRowMid.find(">div:last-child");
	// 设置样式
	oRowMidLeft.addClass("FHBaseUIRecurSelectorMidLeft").css({
		position : "static",
		float : "left",
		height : iRowMidHeight + "px",
		overflow : "hidden"
	});
	// 左边宽 度
	var iMidLeftWidth = oRowMidLeft.outerWidth();

	// 中间 中
	var iPadding = this.MidContentPadding;
	oRowMid.append("<div />");
	var oRowMidContent = oRowMid.find(">div:last-child");
	// 设置样式
	oRowMidContent.addClass("FHBaseUIRecurSelectorMidContent").css({
		position : "static",
		float : "left",
		padding : iPadding + "px",
		"padding-bottom" : "0px",
		height : (iRowMidHeight - iPadding) + "px"
	});

	// 中间 右
	oRowMid.append("<div />");
	var oRowMidRight = oRowMid.find(">div:last-child");
	// 设置样式
	oRowMidRight.addClass("FHBaseUIRecurSelectorMidRight").css({
		position : "static",
		float : "right",
		height : iRowMidHeight + "px",
		overflow : "hidden"
	});
	// 右边宽度
	var iMidRightWidth = oRowMidRight.outerWidth();

	// 中部 设置中间的宽度
	oRowMidContent.css({
		width : (iWidth - iMidLeftWidth - iMidRightWidth - iPadding * 2) + "px"
	});

	// 绘制第三行
	oContainer.append("<div />");
	var oRowBottom = oContainer.find(">div:last-child");
	// 设置样式
	oRowBottom.addClass("FHBaseUIRecurSelectorBottom").css({
		position : "static",
		float : "left",
		width : iWidth + "px",
		clear : "both",
		overflow : "hidden"
	});
	// 第三行行高
	var iRowBottomHeight = oRowBottom.outerHeight();

	// 底部 左
	oRowBottom.append("<div />");
	var oRowBottomLeft = oRowBottom.find(">div:last-child");
	// 设置样式
	oRowBottomLeft.addClass("FHBaseUIRecurSelectorBottomLeft").css({
		position : "static",
		float : "left",
		height : iRowBottomHeight + "px",
		overflow : "hidden"
	});
	// 左边宽度
	var iBottomLeftWidth = oRowBottomLeft.outerWidth();

	// 底部 中
	oRowBottom.append("<div />");
	var oRowBottomMid = oRowBottom.find(">div:last-child");
	// 设置样式
	oRowBottomMid.addClass("FHBaseUIRecurSelectorBottomMid").css({
		position : "static",
		float : "left",
		height : iRowBottomHeight + "px",
		overflow : "hidden"
	});

	// 中间 右
	oRowBottom.append("<div />");
	var oRowBottomRight = oRowBottom.find(">div:last-child");
	// 设置样式
	oRowBottomRight.addClass("FHBaseUIRecurSelectorBottomRight").css({
		position : "static",
		float : "right",
		height : iRowBottomHeight + "px",
		overflow : "hidden"
	});
	// 右边宽度
	var iBottomRightWidth = oRowBottomRight.outerWidth();

	// 底部 设置中间的宽度
	oRowBottomMid.css({
		width : (iWidth - iBottomLeftWidth - iBottomRightWidth) + "px"
	});
};

/**
 * @描述：日历组件 构造函数
 * @开发人员：moshco zhu
 * @开发日期：2010-11-23 上午07:55:05
 * @参数：oTarget, oParam
 * @返回值：any
 * @param oTarget
 * @param oParam
 * @return
 */
function FHBaseUICalendar(oTarget, oParam) {
	// 扩展基础组件对象
	var oComponentClass = {};
	$.extend(oComponentClass, FHBase);
	$.extend(oComponentClass, FHBaseUICalendar);
	$.extend(FHBaseUICalendar, oComponentClass);
	var oComponent = {};
	$.extend(oComponent, FHBASE);
	$.extend(oComponent, this);
	$.extend(this, oComponent);
	// 目标对象
	this.Target = oTarget;
	if (oParam == null) {
		// 参数在目标对象div上
		var strValue = oTarget.val();
		this.Value = ($.trim(strValue) == "") ? null : strValue;
	} else {
		// 参数对象
	}
};

// 星期标题
FHBaseUICalendar.prototype.WeekTitles = [
		"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"
];

// 最小日期
FHBaseUICalendar.prototype.MinDate = {
	year : 1901,
	month : 1,
	day : 1
};

// 最大日期
FHBaseUICalendar.prototype.MaxDate = {
	year : 2049,
	month : 12,
	day : 31
};

// 目标对象
FHBaseUICalendar.prototype.Target = null;

// 容器对象
FHBaseUICalendar.prototype.Container = null;

// 当前年月
FHBaseUICalendar.prototype.CurrentYM = {
	year : -1,
	month : -1
};

// 值
FHBaseUICalendar.prototype.Value = null;

// 当前面板的日期数组
FHBaseUICalendar.prototype.PanelDates = null;

// 鼠标是否在面板上
FHBaseUICalendar.prototype.isMouseOver = false;

/**
 * @描述：当前日期
 * @开发人员：moshco zhu
 * @开发日期：2010-11-29 下午05:43:18
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICalendar.prototype.getCurrentDate = function() {
	// 当前日期
	var dtCurrent = new Date();
	if (this.Value != null) {
		try {
			var stra = this.Value.split("-");
			var iYear = (stra[0].charAt(0) == '0') ? parseInt(stra[0].charAt(1)) : parseInt(stra[0]);
			var iMonth = (stra[1].charAt(0) == '0') ? parseInt(stra[1].charAt(1)) : parseInt(stra[1]);
			var iDay = (stra[2].charAt(0) == '0') ? parseInt(stra[2].charAt(1)) : parseInt(stra[2]);
			dtCurrent = new Date(iYear, iMonth - 1, iDay);
		} catch (e) {
			dtCurrent = new Date();
		}
	}
	// 返回函数值
	return dtCurrent;
};

/**
 * @描述：读取指定日期所在月份的面板日期数组
 * @开发人员：moshco zhu
 * @开发日期：2010-11-24 上午04:39:25
 * @参数：dt
 * @返回值：any
 * @param dt
 * @return
 */
FHBaseUICalendar.prototype.getPanelDate = function(dt) {
	// dt为空表示读取当前日期所在月份的面板日期数组
	if (dt == null) {
		dt = new Date();
	}

	// 读取年月日
	var iYear = dt.getFullYear();
	var iMonth = dt.getMonth() + 1;

	// 当月1号对应的日期
	var dt1 = new Date(iYear, iMonth - 1, 1);
	// 星期序号
	var iWeekIndex = dt1.getDay();
	// 面板起始日期值
	var lFirst = dt1.getTime() - iWeekIndex * 24 * 60 * 60 * 1000;

	// 创建面板日期数组
	var aryDate = new Array(6 * 7);
	var oLunarNext = this.transformLunarDate(new Date(lFirst));
	for ( var i = 0; i < aryDate.length; i++) {
		// 公历日期值
		var lTime = lFirst + i * 24 * 60 * 60 * 1000;
		// 日期对象
		aryDate[i] = {
			date : new Date(lTime),
			lunar : oLunarNext
		};
		// 农历下一天日期对象
		if (i < aryDate.length - 1) {
			oLunarNext = this.getLunarNextDate(oLunarNext);
		}
	}

	// 返回函数值
	return aryDate;
};

/**
 * @描述：组合公历假日的标题
 * @开发人员：moshco zhu
 * @开发日期：2010-11-25 上午11:20:10
 * @参数：aryHoliday
 * @返回值：any
 * @param aryHoliday
 * @return
 */
FHBaseUICalendar.prototype.getCalendarHolidayTitles = function(aryHoliday) {
	// 字符串
	var str = "";
	// 函数:组合字符串
	var fn = function(iIndex, oHoliday) {
		if (oHoliday.is_lunar != null && oHoliday.is_lunar) {
		} else {
			if (str != "") {
				str += ",";
			}
			str += oHoliday.title;
		}
	};
	// 逐一组合
	if (aryHoliday != null && aryHoliday.length > 0) {
		$.each(aryHoliday, fn);
	}
	// 返回函数值
	return (str == "") ? null : str;
};

/**
 * @描述：组合农历假日的标题
 * @开发人员：moshco zhu
 * @开发日期：2010-11-25 上午11:20:53
 * @参数：aryHoliday
 * @返回值：any
 * @param aryHoliday
 * @return
 */
FHBaseUICalendar.prototype.getChineseCalendarHolidayTitles = function(aryHoliday) {
	// 字符串
	var str = "";
	// 函数:组合字符串
	var fn = function(iIndex, oHoliday) {
		if (oHoliday.is_lunar != null && oHoliday.is_lunar) {
			if (str != "") {
				str += ",";
			}
			str += oHoliday.title;
		}
	};
	// 逐一组合
	if (aryHoliday != null && aryHoliday.length > 0) {
		$.each(aryHoliday, fn);
	}
	// 返回函数值
	return (str == "") ? null : str;
};

/**
 * @描述：是否存在24节气的假日
 * @开发人员：moshco zhu
 * @开发日期：2010-11-25 上午11:30:26
 * @参数：aryHoliday
 * @返回值：any
 * @param aryHoliday
 * @return
 */
FHBaseUICalendar.prototype.exist24SolarTerm = function(aryHoliday) {
	// 是否存在
	var bExist = false;
	// 函数：匹配
	var fn = function(iIndex, oHoliday) {
		if (oHoliday.the_24solar_terms_index != null) {
			bExist = true;
			return false;
		}
		return true;
	};
	// 逐一组合
	if (aryHoliday != null && aryHoliday.length > 0) {
		$.each(aryHoliday, fn);
	}
	// 返回函数值
	return bExist;
};

/**
 * @描述：重新绘制指定年月的日期面板
 * @开发人员：moshco zhu
 * @开发日期：2010-11-28 下午05:42:40
 * @参数：iYear, iMonth
 * @返回值：any
 * @param iYear
 * @param iMonth
 * @return
 */
FHBaseUICalendar.prototype.repaintDatePanel = function(iYear, iMonth) {

	// 对象别名
	var oThis = this;

	// 容器对象
	var oContainer = this.Container;

	// 当前日期
	var dtCurrent = this.getCurrentDate();
	var iCurrentYear = dtCurrent.getFullYear();
	var iCurrentMonth = dtCurrent.getMonth() + 1;
	var iCurrentDay = dtCurrent.getDate();

	// 月份面板背景
	var oMonthPanelBg = oContainer.find(".FHBaseUICalendarMonthPanelContentBg");
	var strBgYearMonth = iYear + "年<br>" + iMonth + "月";
	// 背景年月
	oMonthPanelBg.empty();
	oMonthPanelBg.css({
		"opacity" : 0.15,
		filter : "alpha(opacity = 15)"
	});
	oMonthPanelBg.html(strBgYearMonth);

	// 读取当前面板的日期数组
	this.PanelDates = this.getPanelDate(new Date(iYear, iMonth - 1, 1));
	var aryPanelDate = this.PanelDates;
	var iLength = (aryPanelDate == null) ? 0 : aryPanelDate.length;
	if (iLength <= 0) {
		return;
	}

	// 设置每一个格子的日期
	oContainer.find(".FHBaseUICalendarDayCell").each(function() {
		{
			// 日期格子
			var oDayCell = $(this);
			oDayCell.unbind();
			// 序号
			var strIndex = oDayCell.attr("index");
			var iIndex = parseInt(strIndex);
			// 读取日期
			var dt = aryPanelDate[iIndex].date;
			// 公历日
			var iYear1 = dt.getFullYear();
			var iMonth1 = dt.getMonth() + 1;
			var iDay1 = dt.getDate();
			var iWeekIndex1 = dt.getDay();
			// 农历日
			var iLunarYear = aryPanelDate[iIndex].lunar.year;
			var iLunarMonth = aryPanelDate[iIndex].lunar.month;
			var bIsLeapMonth = aryPanelDate[iIndex].lunar.is_leap_month;
			var iLunarDay = aryPanelDate[iIndex].lunar.day;
			var strLunarDay = "";
			if (iLunarDay == 1) {
				strLunarDay += CHINESE_CALENDAR_MONTH_INDEX_ARRAY[aryPanelDate[iIndex].lunar.month - 1];
			}
			strLunarDay += oThis.getLunarDayTitle(iLunarDay);
			// 节假日
			var aryHoliday = oThis.getCalendarHoliday(aryPanelDate[iIndex]);
			// 日期格子Html内容
			var strHtml = "";
			var strTitle = "";
			strHtml += "<center><table><tr><td>";
			// 公历节日
			var strHolidayTitle1 = oThis.getCalendarHolidayTitles(aryHoliday);
			if (strHolidayTitle1 == null) {
				strHtml += "<span index=1>" + iDay1 + "</span>";
				strTitle += iDay1;
			} else {
				strHtml += "<span index=1 holiday=1>" + strHolidayTitle1 + "</span>";
				strTitle += strHolidayTitle1;
			}
			strHtml += "<br />";
			strTitle += "\n"
			// 农历节日
			var strHolidayTitle2 = oThis.getChineseCalendarHolidayTitles(aryHoliday);
			if (strHolidayTitle2 == null) {
				strHtml += "<span index=2>" + strLunarDay + "</span>";
				strTitle += strLunarDay;
			} else {
				strHtml += "<span index=2 holiday=2>" + strHolidayTitle2 + "</span>";
				strTitle += strHolidayTitle2;
			}
			// 二十四节气
			var str24SolarTerm = oThis.get24SolarTerm(iYear1, iMonth1, iDay1);
			if (str24SolarTerm != null && !oThis.exist24SolarTerm(aryHoliday)) {
				strHtml += "/<span index=3>" + str24SolarTerm + "</span>";
				strTitle += "/" + str24SolarTerm;
			}
			strHtml += "</td></tr></table></center>";
			oDayCell.html(strHtml);
			oDayCell.attr("title", strTitle);
			var oTd = oDayCell.find("td");
			oTd.addClass("FHBaseUICalendarDayCellTd");
			// 月
			if ((iYear == iYear1) && (iMonth == iMonth1)) {
				// 本月
				oDayCell.removeClass("FHBaseUICalendarDayCell2");
				oDayCell.addClass("FHBaseUICalendarDayCell1");
				// 公历日期
				oTd.find(">span[index=1]").addClass("FHBaseUICalendarDayCellSpan1");
				// 农历日期
				oTd.find(">span[index=2]").addClass("FHBaseUICalendarDayCellSpan2");
				// 24节气
				if (str24SolarTerm != null) {
					oTd.find(">span[index=3]").addClass("FHBaseUICalendarDayCellSpan3");
				}
				// 节假日
				if (aryHoliday != null) {
					oTd.find(">span[holiday]").removeClass("FHBaseUICalendarDayCellSpan1");
					oTd.find(">span[holiday]").removeClass("FHBaseUICalendarDayCellSpan2");
					oTd.find(">span[holiday]").addClass("FHBaseUICalendarDayCellSpan12");
				}
				// 周末
				if (iWeekIndex1 == 6 || iWeekIndex1 == 0) {
					oTd.find(">span[index=1]").removeClass("FHBaseUICalendarDayCellSpan1");
					oTd.find(">span[index=1]").removeClass("FHBaseUICalendarDayCellSpan12");
					oTd.find(">span[index=1]").addClass("FHBaseUICalendarDayCellSpan11");
				}
				// 今天
				if ((iCurrentYear == iYear1) && (iCurrentMonth == iMonth1) && (iCurrentDay == iDay1)) {
					oTd.addClass("FHBaseUICalendarDayCellTd1");
				}

				// 设置单击事件
				oDayCell.click(function() {
					var oDayCell = $(this);
					oThis.setCurrentValue(oDayCell);
					oThis.Target.focus();
					return true;
				});
			} else {
				// 非本月
				oDayCell.removeClass("FHBaseUICalendarDayCell1");
				oDayCell.addClass("FHBaseUICalendarDayCell2");
			}
		}
	});
};

/**
 * @描述：选择当前年月
 * @开发人员：moshco zhu
 * @开发日期：2010-11-30 上午11:17:48
 * @参数：iYear, iMonth
 * @返回值：any
 * @param iYear
 * @param iMonth
 * @return
 */
FHBaseUICalendar.prototype.selectCurrentYearMonth = function(iYear, iMonth) {
	// 对象别名
	var oThis = this;
	// 容器对象
	var oContainer = this.Container;
	// 选择年
	oContainer.find(".FHBaseUICalendarYearListCell").each(function() {
		$(this).removeClass("FHBaseUICalendarYearListCell3");
		$(this).addClass("FHBaseUICalendarYearListCell1");
		var iYear1 = parseInt($(this).attr("year"));
		if (oThis.CurrentYM.year == iYear1) {
			$(this).removeClass("FHBaseUICalendarYearListCell1");
			$(this).removeClass("FHBaseUICalendarYearListCell2");
			$(this).addClass("FHBaseUICalendarYearListCell3");
		}
	});
	// 选择月
	oContainer.find(".FHBaseUICalendarMonthListCell").each(function() {
		$(this).removeClass("FHBaseUICalendarMonthListCell3");
		$(this).addClass("FHBaseUICalendarMonthListCell1");
		var iMonth1 = parseInt($(this).attr("month"));
		if (oThis.CurrentYM.month == iMonth1) {
			$(this).removeClass("FHBaseUICalendarMonthListCell1");
			$(this).removeClass("FHBaseUICalendarMonthListCell2");
			$(this).addClass("FHBaseUICalendarMonthListCell3");
		}
	});

};

/**
 * @描述：设置当前年月按钮
 * @开发人员：moshco zhu
 * @开发日期：2010-11-30 上午11:15:00
 * @参数：iYear, iMonth
 * @返回值：any
 * @param iYear
 * @param iMonth
 * @return
 */
FHBaseUICalendar.prototype.setCurrentYearMonthButton = function(iYear, iMonth) {
	// 对象别名
	var oThis = this;
	// 容器对象
	var oContainer = this.Container;
	// 日期年
	var oTheYear = oContainer.find(".FHBaseUICalendarBottomToolBarUnit1TheYear");
	oTheYear.click(function() {
		oThis.CurrentYM.year = iYear;
		oThis.repaintDatePanel(oThis.CurrentYM.year, oThis.CurrentYM.month);
		oThis.selectCurrentYearMonth(iYear, iMonth);
		oThis.Target.focus();
		return true;
	});
	oTheYear.html(iYear);

	// 上月 本月 下月
	oContainer.find(".FHBaseUICalendarBottomToolBarUnit1Btn").each(function() {
		var iIndex = parseInt($(this).attr("index"));
		if (iIndex == 1) {
			$(this).html("上");
		} else if (iIndex == 2) {
			$(this).html(iMonth);
		} else if (iIndex == 3) {
			$(this).html("下");
		}
		$(this).click(function() {
			var iYear1 = iYear;
			var iMonth1 = iMonth + iIndex - 2;
			if (iMonth1 > 12) {
				iYear1++;
				iMonth1 = 1;
			}
			oThis.CurrentYM = {
				year : iYear1,
				month : iMonth1
			};
			oThis.repaintDatePanel(iYear1, iMonth1);
			oThis.selectCurrentYearMonth(iYear, iMonth);
			oThis.Target.focus();
			return true;
		});
	});

	// 四季
	var oSeasons = oContainer.find(".FHBaseUICalendarBottomToolBarUnit2");
	oSeasons.removeClass("FHBaseUICalendarBottomToolBarSpring");
	oSeasons.removeClass("FHBaseUICalendarBottomToolBarSummer");
	oSeasons.removeClass("FHBaseUICalendarBottomToolBarSwing");
	oSeasons.removeClass("FHBaseUICalendarBottomToolBarWinter");
	if (iMonth >= 3 && iMonth <= 5) {
		oSeasons.addClass("FHBaseUICalendarBottomToolBarSpring");
	} else if (iMonth >= 6 && iMonth <= 8) {
		oSeasons.addClass("FHBaseUICalendarBottomToolBarSummer");
	} else if (iMonth >= 9 && iMonth <= 11) {
		oSeasons.addClass("FHBaseUICalendarBottomToolBarSwing");
	} else if (iMonth == 12 || iMonth == 1 || iMonth == 2) {
		oSeasons.addClass("FHBaseUICalendarBottomToolBarWinter");
	}
};

/**
 * @描述：设置当前值
 * @开发人员：moshco zhu
 * @开发日期：2010-11-29 下午06:27:56
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICalendar.prototype.setCurrentValue = function(oDayCell) {
	// 序号
	var strIndex = oDayCell.attr("index");
	var iIndex = parseInt(strIndex);
	// 读取日期
	var dt = this.PanelDates[iIndex].date;
	// 年月日
	var iYear = dt.getFullYear();
	var iMonth = dt.getMonth() + 1;
	var iDay = dt.getDate();
	var str = "";
	str += (iYear < 10) ? "0" + iYear : iYear;
	str += "-";
	str += (iMonth < 10) ? "0" + iMonth : iMonth;
	str += "-";
	str += (iDay < 10) ? "0" + iDay : iDay;
	// 设置当前值
	this.Value = str;
	this.Target.val(str);
	// 设置被选择
	this.Container.find(".FHBaseUICalendarDayCellTd").each(function() {
		$(this).removeClass("FHBaseUICalendarDayCellTd1");
	});
	oDayCell.find("td").addClass("FHBaseUICalendarDayCellTd1");
	// 设置当前年月按钮
	this.setCurrentYearMonthButton(iYear, iMonth);
};

/**
 * @描述：设置容器到合适位置
 * @开发人员：moshco zhu
 * @开发时间：2011-6-11 上午12:17:57
 */
FHBaseUICalendar.prototype.setFitPosition = function() {
	// 目标对象
	var oTarget = this.Target;
	var iTargetHeight = oTarget.outerHeight();
	// 读取目标对象的位置
	var oOffset = oTarget.offset();
	var iLeft = oOffset.left;
	var iTop = oOffset.top + iTargetHeight;

	var iScollTop = $(window.document.body).scrollTop();
	iTop += iScollTop;

	if (iTop + this.Container.outerHeight() > $(window.document.body).height()) {
		iTop = $(window.document.body).height() - this.Container.outerHeight();
	}
	if (iLeft + this.Container.outerWidth() > $(window.document.body).width()) {
		iLeft = $(window.document.body).width() - this.Container.outerWidth();
	}
	this.Container.css({
		left : iLeft + "px",
		top : iTop + "px"
	});
	// 返回函数值
	return false;
};

/**
 * @描述：初始化
 * @开发人员：moshco zhu
 * @开发日期：2010-11-23 上午08:09:22
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICalendar.prototype.init = function() {

	// 对象别名
	var oThis = this;

	// 确定容器
	if (this.Container == null || this.Container.length != 1) {
		var strCode = this.Target.attr(FHBaseUICalendar.TARGET_ATTR_NAME_CODE);
		$(window.document.body).find(".FHBaseUICalendar").each(function() {
			if ($(this).attr(FHBaseUICalendar.ATTR_NAME_CODE) == strCode) {
				oThis.Container = $(this);
			}
		});
		this.Container.show();
	}
	// 容器对象
	var oContainer = this.Container;

	// 当前日期
	var dtCurrent = this.getCurrentDate();

	// 绘制日期面板
	var iCurrentYear = dtCurrent.getFullYear();
	var iCurrentMonth = dtCurrent.getMonth() + 1;
	this.CurrentYM = {
		year : iCurrentYear,
		month : iCurrentMonth
	};
	this.repaintDatePanel(iCurrentYear, iCurrentMonth);

	// 设置日期年、最近月按钮
	this.setCurrentYearMonthButton(iCurrentYear, iCurrentMonth);

	// 年份列表
	var oYearListCell = oContainer.find(".FHBaseUICalendarYearListCell");
	oYearListCell.each(function() {
		var iIndex = parseInt($(this).attr("index"));
		$(this).attr("year", iCurrentYear + iIndex);
		$(this).html(iCurrentYear + iIndex);
		if ((iCurrentYear + iIndex) == oThis.CurrentYM.year) {
			$(this).removeClass("FHBaseUICalendarYearListCell1");
			$(this).removeClass("FHBaseUICalendarYearListCell2");
			$(this).addClass("FHBaseUICalendarYearListCell3");
		}
		$(this).click(function() {
			oThis.CurrentYM.year = parseInt($(this).attr("year"));
			oThis.repaintDatePanel(oThis.CurrentYM.year, oThis.CurrentYM.month);
			oContainer.find(".FHBaseUICalendarYearListCell").each(function() {
				$(this).removeClass("FHBaseUICalendarYearListCell3");
				$(this).addClass("FHBaseUICalendarYearListCell1");
			});
			$(this).removeClass("FHBaseUICalendarYearListCell1");
			$(this).removeClass("FHBaseUICalendarYearListCell2");
			$(this).addClass("FHBaseUICalendarYearListCell3");
			oThis.Target.focus();
			return true;
		});
	});
	oYearListCell.hover(function() {
		if (!$(this).hasClass("FHBaseUICalendarYearListCell3")) {
			$(this).removeClass("FHBaseUICalendarYearListCell1");
			$(this).addClass("FHBaseUICalendarYearListCell2");
		}
		return true;
	}, function() {
		if (!$(this).hasClass("FHBaseUICalendarYearListCell3")) {
			$(this).removeClass("FHBaseUICalendarYearListCell2");
			$(this).addClass("FHBaseUICalendarYearListCell1");
		}
		return true;
	});

	// 函数：下一年
	var fn1 = function(iAddYear) {
		// 最小年 最大年
		var iMinYear = -1;
		var iMaxYear = -1;
		oContainer.find(".FHBaseUICalendarYearListCell").each(function() {
			var iYear = parseInt($(this).attr("year"));
			if ((iMinYear > iYear) || (iMinYear == -1)) {
				iMinYear = iYear;
			}
			if ((iMaxYear < iYear) || (iMaxYear == -1)) {
				iMaxYear = iYear;
			}
		});
		// 有效的增加值
		if ((iMinYear + iAddYear) <= oThis.MinDate.year) {
			iAddYear = oThis.MinDate.year - iMinYear;
		}
		if ((iMaxYear + iAddYear) >= oThis.MaxDate.year) {
			iAddYear = oThis.MaxDate.year - iMaxYear;
		}
		// 设置新的年号
		oContainer.find(".FHBaseUICalendarYearListCell").each(function() {
			var iYear = parseInt($(this).attr("year"));
			iYear += iAddYear;
			$(this).attr("year", iYear);
			$(this).html(iYear);
			$(this).removeClass("FHBaseUICalendarYearListCell3");
			$(this).addClass("FHBaseUICalendarYearListCell1");
			if (oThis.CurrentYM.year == iYear) {
				$(this).removeClass("FHBaseUICalendarYearListCell1");
				$(this).removeClass("FHBaseUICalendarYearListCell2");
				$(this).addClass("FHBaseUICalendarYearListCell3");
			}
		});
	};

	// 上一年
	var oPriorYear = oContainer.find(".FHBaseUICalendarPriorYear");
	oPriorYear.click(function() {
		fn1(-1);
		oThis.Target.focus();
		return true;
	});
	oPriorYear.dblclick(function() {
		fn1(-9);
		oThis.Target.focus();
		return true;
	});
	oPriorYear.hover(function() {
		$(this).removeClass("FHBaseUICalendarPriorYear1");
		$(this).addClass("FHBaseUICalendarPriorYear2");
		return true;
	}, function() {
		$(this).removeClass("FHBaseUICalendarPriorYear2");
		$(this).addClass("FHBaseUICalendarPriorYear1");
		return true;
	});

	// 下一年
	var oNextYear = oContainer.find(".FHBaseUICalendarNextYear");
	oNextYear.click(function() {
		fn1(1);
		oThis.Target.focus();
		return true;
	});
	oNextYear.dblclick(function() {
		fn1(9);
		oThis.Target.focus();
		return true;
	});
	oNextYear.hover(function() {
		$(this).removeClass("FHBaseUICalendarNextYear1");
		$(this).addClass("FHBaseUICalendarNextYear2");
		return true;
	}, function() {
		$(this).removeClass("FHBaseUICalendarNextYear2");
		$(this).addClass("FHBaseUICalendarNextYear1");
		return true;
	});

	// 月份列表
	var oMonthListCell = oContainer.find(".FHBaseUICalendarMonthListCell");
	oMonthListCell.each(function() {
		var iIndex = parseInt($(this).attr("index"));
		$(this).html(iIndex + 1);
		$(this).attr("month", iIndex + 1);
		if ((iIndex + 1) == oThis.CurrentYM.month) {
			$(this).removeClass("FHBaseUICalendarMonthListCell1");
			$(this).removeClass("FHBaseUICalendarMonthListCell2");
			$(this).addClass("FHBaseUICalendarMonthListCell3");
		}
		$(this).click(function() {
			oThis.CurrentYM.month = iIndex + 1;
			oThis.repaintDatePanel(oThis.CurrentYM.year, oThis.CurrentYM.month);
			oContainer.find(".FHBaseUICalendarMonthListCell").each(function() {
				$(this).removeClass("FHBaseUICalendarMonthListCell3");
				$(this).addClass("FHBaseUICalendarMonthListCell1");
			});
			$(this).removeClass("FHBaseUICalendarMonthListCell1");
			$(this).removeClass("FHBaseUICalendarMonthListCell2");
			$(this).addClass("FHBaseUICalendarMonthListCell3");
			oThis.Target.focus();
			return true;
		});
	});
	oMonthListCell.hover(function() {
		if (!$(this).hasClass("FHBaseUICalendarMonthListCell3")) {
			$(this).removeClass("FHBaseUICalendarMonthListCell1");
			$(this).addClass("FHBaseUICalendarMonthListCell2");
		}
		return true;
	}, function() {
		if (!$(this).hasClass("FHBaseUICalendarMonthListCell3")) {
			$(this).removeClass("FHBaseUICalendarMonthListCell2");
			$(this).addClass("FHBaseUICalendarMonthListCell1");
		}
		return true;
	});

	// 今天按钮
	var oBtnToday = oContainer.find(".FHBaseUICalendarBottomToolBarToday");
	oBtnToday.hover(function() {
		$(this).removeClass("FHBaseUICalendarBottomToolBarToday1");
		$(this).addClass("FHBaseUICalendarBottomToolBarToday2");
		return true;
	}, function() {
		$(this).removeClass("FHBaseUICalendarBottomToolBarToday2");
		$(this).addClass("FHBaseUICalendarBottomToolBarToday1");
		return true;
	});
	oBtnToday.click(function() {
		var dtCurrent = new Date();
		var iYear = dtCurrent.getFullYear();
		var iMonth = dtCurrent.getMonth() + 1;
		var iDay = dtCurrent.getDate();
		oThis.CurrentYM = {
			year : iYear,
			month : iMonth
		};
		var str = "";
		str += (iYear < 10) ? "0" + iYear : "" + iYear;
		str += "-";
		str += (iMonth < 10) ? "0" + iMonth : "" + iMonth;
		str += "-";
		str += (iDay < 10) ? "0" + iDay : "" + iDay;
		oThis.Value = str;
		oThis.Target.val(str);
		oThis.repaintDatePanel(iYear, iMonth);
		oThis.selectCurrentYearMonth(iYear, iMonth);
		oThis.setCurrentYearMonthButton(iYear, iMonth);
		oThis.Target.focus();
		return true;
	});

	// 显示和关闭
	oThis.Container.hide();
	this.Target.unbind().click(function() {
		oThis.Container.show(300, function() {
			oThis.setFitPosition();
		});
		return true;
	}).focus(function() {
		oThis.Container.show(300, function() {
			oThis.setFitPosition();
		});
		return true;
	}).blur(function() {
		if (!oThis.isMouseOver) {
			oThis.Container.hide(500);
		}
		return true;
	});

	// 设置鼠标是否在容器上
	oThis.Container.unbind().mouseover(function() {
		oThis.isMouseOver = true;
		return false;
	}).mouseout(function() {
		oThis.isMouseOver = false;
		return false;
	});

	// 关闭按钮
	var oBtnClose = oContainer.find(".FHBaseUICalendarBottomToolBarClose");
	oBtnClose.hover(function() {
		$(this).removeClass("FHBaseUICalendarBottomToolBarClose1");
		$(this).addClass("FHBaseUICalendarBottomToolBarClose2");
		return true;
	}, function() {
		$(this).removeClass("FHBaseUICalendarBottomToolBarClose2");
		$(this).addClass("FHBaseUICalendarBottomToolBarClose1");
		return true;
	});
	oBtnClose.click(function() {
		oThis.Container.hide(500);
		return false;
	});
};

/**
 * @描述：绘制底部工具条：单元块1
 * @开发人员：moshco zhu
 * @开发日期：2010-11-28 上午07:30:36
 * @参数：oUnit1
 * @返回值：any
 * @param oUnit1
 * @return
 */
FHBaseUICalendar.prototype.paintToolbarUnit1 = function(oUnit1) {

	// 单元块的宽度、高度
	var iUnit1Width = oUnit1.width();
	var iUnit1Height = oUnit1.height();

	// 本年
	oUnit1.append("<div />");
	var oTheYear = oUnit1.find(">div:last-child");
	// 设置样式
	oTheYear.addClass("FHBaseUICalendarBottomToolBarUnit1TheYear").css({
		position : "static",
		width : iUnit1Width + "px",
		overflow : "hidden",
		clear : "both"
	});

	// 间隔
	oUnit1.append("<div />");
	var oUnit1Blank1 = oUnit1.find(">div:last-child");
	// 设置样式
	oUnit1Blank1.css({
		position : "static",
		width : iUnit1Width + "px",
		height : "2px",
		overflow : "hidden",
		clear : "both"
	});

	// 计算按钮块的宽度、高度
	var iButtonBlankWidth = 2;
	var iButtonWidth = parseInt((iUnit1Width - iButtonBlankWidth * 2) / 3);
	var iButtonWidth2 = iUnit1Width - iButtonBlankWidth * 2 - iButtonWidth * 2;
	var iButtonHeight = iUnit1Height - oTheYear.outerHeight() - oUnit1Blank1.outerHeight();

	// 上月
	oUnit1.append("<div />");
	var oBtn1 = oUnit1.find(">div:last-child");
	// 设置样式
	oBtn1.addClass("FHBaseUICalendarBottomToolBarUnit1Btn").css({
		position : "static",
		float : "left",
		width : iButtonWidth + "px",
		height : iButtonHeight + "px",
		"line-height" : iButtonHeight + "px",
		overflow : "hidden"
	});
	// 设置序号
	oBtn1.attr("index", 1);

	// 间隔
	oUnit1.append("<div />");
	var oBtnBlank1 = oUnit1.find(">div:last-child");
	// 设置样式
	oBtnBlank1.css({
		position : "static",
		float : "left",
		width : iButtonBlankWidth + "px",
		height : iButtonHeight + "px",
		overflow : "hidden"
	});

	// 本月
	oUnit1.append("<div />");
	var oBtn2 = oUnit1.find(">div:last-child");
	// 设置样式
	oBtn2.addClass("FHBaseUICalendarBottomToolBarUnit1Btn").css({
		position : "static",
		float : "left",
		width : iButtonWidth2 + "px",
		height : iButtonHeight + "px",
		"line-height" : iButtonHeight + "px",
		overflow : "hidden"
	});
	// 设置序号
	oBtn2.attr("index", 2);

	// 间隔
	oUnit1.append("<div />");
	var oBtnBlank2 = oUnit1.find(">div:last-child");
	// 设置样式
	oBtnBlank2.css({
		position : "static",
		float : "left",
		width : iButtonBlankWidth + "px",
		height : iButtonHeight + "px",
		overflow : "hidden"
	});

	// 下月
	oUnit1.append("<div />");
	var oBtn3 = oUnit1.find(">div:last-child");
	// 设置样式
	oBtn3.addClass("FHBaseUICalendarBottomToolBarUnit1Btn").css({
		position : "static",
		float : "left",
		width : iButtonWidth + "px",
		height : iButtonHeight + "px",
		"line-height" : iButtonHeight + "px",
		overflow : "hidden"
	});
	// 设置序号
	oBtn3.attr("index", 3);
};

/**
 * @描述：绘制底部工具条：单元块3
 * @开发人员：moshco zhu
 * @开发日期：2010-11-28 上午07:44:23
 * @参数：oUnit3
 * @返回值：any
 * @param oUnit3
 * @return
 */
FHBaseUICalendar.prototype.paintToolbarUnit3 = function(oUnit3) {

	// 读取高度
	var iUnit3Height = oUnit3.height();

	// 第一行：年份列表
	oUnit3.append("<div />");
	var oYearList = oUnit3.find(">div:last-child");
	// 设置样式
	oYearList.addClass("FHBaseUICalendarYearList").css({
		position : "static",
		clear : "both"
	});

	// 年份列表的高度和宽度
	var iYearListWidth = oYearList.width();
	var iYearListHeight = oYearList.height();

	// 按钮：上一年
	oYearList.append("<div />");
	var oPriorYear = oYearList.find(">div:last-child");
	// 设置样式
	oPriorYear.addClass("FHBaseUICalendarPriorYear").addClass("FHBaseUICalendarPriorYear1").css({
		position : "static",
		float : "left",
		height : iYearListHeight + "px"
	});

	// 列表：年份列表容器
	oYearList.append("<div />");
	var oContainer = oYearList.find(">div:last-child");
	// 设置样式
	oContainer.addClass("FHBaseUICalendarYearListContainer").css({
		position : "static",
		float : "left",
		"overflow" : "hidden"
	});

	// 按钮：下一年
	oYearList.append("<div />");
	var oNextYear = oYearList.find(">div:last-child");
	// 设置样式
	oNextYear.addClass("FHBaseUICalendarNextYear").addClass("FHBaseUICalendarNextYear1").css({
		position : "static",
		float : "left",
		height : iYearListHeight + "px"
	});

	// 容器的宽度
	var iContainerWidth = iYearListWidth - oPriorYear.outerWidth() - oNextYear.outerWidth();
	// 设置容器宽度
	oContainer.css({
		width : iContainerWidth + "px"
	});

	// 列表：年份列表Bar条
	oContainer.append("<div />");
	var oBar = oContainer.find(">div:last-child");
	// 设置样式
	oBar.addClass("FHBaseUICalendarYearListBar").css({
		position : "static"
	});

	// 间隔样式
	var oBlankCss = {
		position : "static",
		float : "left",
		width : 2 + "px",
		height : iYearListHeight + "px"
	};

	// 绘制年份
	var iIndex = 0;
	var iTotalWidth = 0;
	while (iTotalWidth < iContainerWidth) {
		// 年份格子
		oBar.append("<div />");
		var oYearCell = oBar.find(">div:last-child");
		// 设置样式
		oYearCell.addClass("FHBaseUICalendarYearListCell");
		oYearCell.addClass("FHBaseUICalendarYearListCell1");
		oYearCell.css({
			position : "static",
			float : "left",
			"white-space" : "nowrap",
			height : (iYearListHeight - 2) + "px",
			"line-height" : (iYearListHeight - 2) + "px"
		});
		// 设置序号
		oYearCell.attr("index", iIndex++);

		// 间隔
		oBar.append("<div />");
		var oYearBlank = oBar.find(">div:last-child");
		// 设置样式
		oYearBlank.css(oBlankCss);

		// 计算总计宽度
		iTotalWidth += oYearCell.outerWidth() + oYearBlank.outerWidth();
	}

	// 设置Bar的宽度
	oBar.css({
		width : iTotalWidth + "px"
	});

	// 间隔
	oUnit3.append("<div />");
	var oUnit3Blank1 = oUnit3.find(">div:last-child");
	// 设置样式
	oUnit3Blank1.css({
		position : "static",
		width : iYearListWidth + "px",
		height : "2px",
		overflow : "hidden",
		clear : "both"
	});

	// 第二行：月份列表
	var iMonthListHeight = iUnit3Height - iYearListHeight - 2;// 月份列表的高度
	oUnit3.append("<div />");
	var oMonthList = oUnit3.find(">div:last-child");
	// 设置样式
	oMonthList.addClass("FHBaseUICalendarMonthList").css({
		position : "static",
		width : iYearListWidth + "px",
		height : iMonthListHeight + "px",
		clear : "both"
	});

	// 间隔
	oMonthList.append("<div />");
	var oLeftBlank = oMonthList.find(">div:last-child");
	// 设置样式
	oLeftBlank.css({
		position : "static",
		"float" : "left",
		width : oPriorYear.outerWidth() + "px",
		height : iMonthListHeight + "px",
		clear : "both"
	});

	// 月份按钮
	for ( var i = 0; i < 12; i++) {
		// 年份格子
		oMonthList.append("<div />");
		var oMonthCell = oMonthList.find(">div:last-child");
		// 设置样式
		oMonthCell.addClass("FHBaseUICalendarMonthListCell");
		oMonthCell.addClass("FHBaseUICalendarMonthListCell1");
		oMonthCell.css({
			position : "static",
			float : "left",
			"white-space" : "nowrap",
			height : (iMonthListHeight - 2) + "px",
			"line-height" : (iMonthListHeight - 2) + "px"
		});
		// 设置序号
		oMonthCell.attr("index", i);

		// 间隔
		oMonthList.append("<div />");
		var oMonthBlank = oMonthList.find(">div:last-child");
		// 设置样式
		oMonthBlank.css(oBlankCss);
	}

};

/**
 * @描述：绘制底部工具条：单元块4
 * @开发人员：moshco zhu
 * @开发日期：2010-11-30 上午10:05:23
 * @参数：oUnit3
 * @返回值：any
 * @param oUnit3
 * @return
 */
FHBaseUICalendar.prototype.paintToolbarUnit4 = function(oUnit4) {

	// 读取宽度、高度
	var iUnit4Width = oUnit4.height();
	var iUnit4Height = oUnit4.height();

	// 按钮：今天
	oUnit4.append("<div />");
	var oToday = oUnit4.find(">div:last-child");
	// 设置样式
	oToday.addClass("FHBaseUICalendarBottomToolBarToday");
	oToday.addClass("FHBaseUICalendarBottomToolBarToday1");
	oToday.css({
		position : "static",
		width : iUnit4Width + "px",
		clear : "both"
	});

	// 间隔
	oUnit4.append("<div />");
	var oUnit4Blank1 = oUnit4.find(">div:last-child");
	// 设置样式
	oUnit4Blank1.css({
		position : "static",
		width : iUnit4Width + "px",
		height : "2px",
		overflow : "hidden",
		clear : "both"
	});

	// 按钮：关闭
	oUnit4.append("<div />");
	var oClose = oUnit4.find(">div:last-child");
	// 设置样式
	oClose.addClass("FHBaseUICalendarBottomToolBarClose");
	oClose.addClass("FHBaseUICalendarBottomToolBarClose1");
	oClose.css({
		position : "static",
		width : iUnit4Width + "px",
		height : (iUnit4Height - oToday.outerHeight() - 2) + "px",
		clear : "both"
	});

};

/**
 * @描述：绘制底部
 * @开发人员：moshco zhu
 * @开发日期：2010-11-28 上午07:24:42
 * @参数：oBottom
 * @返回值：any
 * @param oBottom
 * @return
 */
FHBaseUICalendar.prototype.paintBottom = function(oBottom) {

	// 底部宽度
	var iBottomWidth = oBottom.width();

	// 边线
	oBottom.append("<div />");
	var oTopSide = oBottom.find(">div:last-child");
	// 设置样式
	oTopSide.addClass("FHBaseUICalendarBottomTopSide").css({
		position : "static",
		float : "left",
		width : iBottomWidth + "px",
		overflow : "hidden",
		clear : "both"
	});

	// 工具条
	oBottom.append("<div />");
	var oToolBar = oBottom.find(">div:last-child");
	// 设置样式
	oToolBar.addClass("FHBaseUICalendarBottomToolBar").css({
		position : "static",
		float : "left",
		width : iBottomWidth + "px",
		clear : "both"
	});

	// 工具条的高度
	var iToolBarHeight = oToolBar.height();

	// 间隔块的宽度
	var oBlankCss = {
		position : "static",
		float : "left",
		width : 0 + "px",
		height : iToolBarHeight + "px",
		overflow : "hidden"
	};

	// 单元块：本年本月
	oToolBar.append("<div />");
	var oUnit1 = oToolBar.find(">div:last-child");
	// 设置样式
	oUnit1.addClass("FHBaseUICalendarBottomToolBarUnit1").css({
		position : "static",
		float : "left",
		height : iToolBarHeight + "px",
		overflow : "hidden"
	});

	// 绘制单元块：本年本月
	this.paintToolbarUnit1(oUnit1);

	// 间隔
	oToolBar.append("<div />");
	var oBlank1 = oToolBar.find(">div:last-child");
	// 设置样式
	oBlank1.addClass("FHBaseUICalendarBottomBlank").css(oBlankCss);

	// 单元块：季节
	oToolBar.append("<div />");
	var oUnit2 = oToolBar.find(">div:last-child");
	// 设置样式
	oUnit2.addClass("FHBaseUICalendarBottomToolBarUnit2").css({
		position : "static",
		float : "left",
		height : iToolBarHeight + "px",
		overflow : "hidden"
	});

	// 间隔
	oToolBar.append("<div />");
	var oBlank2 = oToolBar.find(">div:last-child");
	// 设置样式
	oBlank2.addClass("FHBaseUICalendarBottomBlank").css(oBlankCss);

	// 单元块：年月列表
	oToolBar.append("<div />");
	var oUnit3 = oToolBar.find(">div:last-child");
	// 设置样式
	oUnit3.addClass("FHBaseUICalendarBottomToolBarUnit3").css({
		position : "static",
		float : "left",
		height : iToolBarHeight + "px",
		overflow : "hidden"
	});

	// 绘制单元块：年月列表
	this.paintToolbarUnit3(oUnit3);
	oUnit3.width(oUnit3.outerWidth());

	// 间隔
	oToolBar.append("<div />");
	var oBlank3 = oToolBar.find(">div:last-child");
	// 设置样式
	oBlank3.addClass("FHBaseUICalendarBottomBlank").css(oBlankCss);

	// 单元块：今天、关闭
	oToolBar.append("<div />");
	var oUnit4 = oToolBar.find(">div:last-child");
	// 设置样式
	oUnit4.addClass("FHBaseUICalendarBottomToolBarUnit4").css({
		position : "static",
		float : "right",
		height : iToolBarHeight + "px",
		overflow : "hidden"
	});

	// 绘制单元块：今天、关闭
	this.paintToolbarUnit4(oUnit4);

	// 设置间隔列的宽度
	var iLaveWidth = iBottomWidth - oUnit1.outerWidth() - oUnit2.outerWidth() - oUnit3.outerWidth() - oUnit4.outerWidth();
	var oBottomBlanks = oBottom.find(".FHBaseUICalendarBottomBlank");
	var iBlankWidth = parseInt(iLaveWidth / oBottomBlanks.length);
	oBottomBlanks.each(function() {
		$(this).css({
			width : iBlankWidth + "px"
		});
	});
};

/**
 * @描述：绘制中部
 * @开发人员：moshco zhu
 * @开发日期：2010-11-28 上午07:19:01
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICalendar.prototype.paintMid = function(oMid) {

	// 面板宽度
	var iMonthPanelWidth = oMid.width();

	// 单月日期面板
	oMid.append("<div />");
	var oMonthPanel = oMid.find(">div:last-child");
	// 设置样式
	oMonthPanel.addClass("FHBaseUICalendarMonthPanel").css({
		position : "static",
		float : "left",
		width : iMonthPanelWidth + "px",
		clear : "both",
		overflow : "hidden"
	});

	// 星期标题条
	oMonthPanel.append("<div />");
	var oWeekTitleBar = oMonthPanel.find(">div:last-child");
	// 设置样式
	oWeekTitleBar.addClass("FHBaseUICalendarWeekTitleBar").css({
		position : "static",
		float : "left",
		width : iMonthPanelWidth + "px",
		clear : "both",
		overflow : "hidden"
	});

	// 标题高度
	var iWeekTitleBarHeight = oWeekTitleBar.height();

	// 每一列的间隔
	var iBlankWidth = 2;

	// 计算每列的宽度
	var iColumnWidth = (iMonthPanelWidth - iBlankWidth * (this.WeekTitles.length - 1)) / this.WeekTitles.length;
	iColumnWidth = parseInt(iColumnWidth);
	var iLastColumnWidth = iMonthPanelWidth;

	// 绘制每一列
	for ( var i = 0; i < this.WeekTitles.length; i++) {
		// 标题格子
		oWeekTitleBar.append("<div />");
		var oTitleCell = oWeekTitleBar.find(">div:last-child");
		// 设置样式
		oTitleCell.addClass("FHBaseUICalendarWeekTitleCell").css({
			position : "static",
			float : "left",
			height : iWeekTitleBarHeight + "px",
			"line-height" : iWeekTitleBarHeight + "px",
			"text-align" : "center",
			"white-space" : "nowrap"
		});

		// 星期标题
		oTitleCell.html(this.WeekTitles[i]);

		// 设置宽度
		if (i == (this.WeekTitles.length - 1)) {
			// 最后一列
			oTitleCell.css({
				width : iLastColumnWidth + "px"
			});

		} else {
			// 前6列
			oTitleCell.css({
				width : iColumnWidth + "px"
			});
			// 最后一列的宽度
			iLastColumnWidth -= iColumnWidth;
		}

		// 间隔列
		if (i != (this.WeekTitles.length - 1)) {
			// 标题格子
			oWeekTitleBar.append("<div />");
			var oTitleBlank = oWeekTitleBar.find(">div:last-child");
			// 设置样式
			oTitleBlank.addClass("FHBaseUICalendarWeekTitleBlank").css({
				position : "static",
				float : "left",
				width : iBlankWidth + "px",
				height : iWeekTitleBarHeight + "px",
				overflow : "hidden"
			});
			// 最后一列的宽度
			iLastColumnWidth -= iBlankWidth;
		}
	}

	// 每一行的高度
	var iRowHeight = 35;
	var iPanelContentHeight = iRowHeight * 6;

	// 面板内容
	oMonthPanel.append("<div />");
	var oPanelContent = oMonthPanel.find(">div:last-child");
	// 设置样式
	oPanelContent.addClass("FHBaseUICalendarMonthPanelContent").css({
		position : "static",
		float : "left",
		width : iMonthPanelWidth + "px",
		height : iPanelContentHeight + "px",
		clear : "both"
	});

	// 面板背景容器
	oPanelContent.append("<div />");
	var oPanelBgContainer = oPanelContent.find(">div:last-child");
	oPanelBgContainer.css({
		position : "absolute",
		width : iMonthPanelWidth + "px",
		height : iPanelContentHeight + "px",
		overflow : "hidden",
		"z-index" : 1
	});

	// 面板背景
	oPanelBgContainer.append("<div />");
	var oPanelBg = oPanelBgContainer.find(">div:last-child");
	// 设置样式
	oPanelBg.addClass("FHBaseUICalendarMonthPanelContentBg").css({
		position : "static",
		float : "left",
		width : iMonthPanelWidth + "px",
		height : iPanelContentHeight + "px",
		"line-height" : (iPanelContentHeight / 2) + "px",
		"text-align" : "center",
		"opacity" : 0.15,
		filter : "alpha(opacity = 15)"
	});
	// 设置背景文本
	oPanelBg.html("0000年<br>00月");

	// 面板日期容器
	oPanelContent.append("<div />");
	var oPanelDayContainer = oPanelContent.find(">div:last-child");
	oPanelDayContainer.css({
		position : "absolute",
		width : iMonthPanelWidth + "px",
		height : iPanelContentHeight + "px",
		overflow : "hidden",
		"z-index" : 2
	});

	var css1 = {
		position : "static",
		float : "left",
		width : iMonthPanelWidth + "px",
		height : iRowHeight + "px",
		"line-height" : (iRowHeight / 2) + "px",
		"text-align" : "center",
		overflow : "hidden",
		clear : "both"
	};
	var css2 = {
		position : "static",
		float : "left",
		height : iRowHeight + "px",
		"line-height" : (iRowHeight / 2) + "px",
		"text-align" : "center",
		overflow : "hidden"
	};
	var css3 = {
		position : "static",
		float : "left",
		width : iBlankWidth + "px",
		height : iRowHeight + "px",
		overflow : "hidden"
	};

	// 绘制6行：每月最多跨6周
	var iIndex = 0;
	for ( var i = 0; i < 6; i++) {
		// 一周一行
		oPanelDayContainer.append("<div />");
		var oWeekRow = oPanelDayContainer.find(">div:last-child");
		// 设置样式
		oWeekRow.addClass("FHBaseUICalendarWeekRow").css(css1);

		// 每周7天
		for ( var j = 0; j < this.WeekTitles.length; j++) {
			// 每天一个格子
			oWeekRow.append("<div />");
			var oDayCell = oWeekRow.find(">div:last-child");
			// 设置样式
			oDayCell.addClass("FHBaseUICalendarDayCell").addClass("FHBaseUICalendarDayCell1").css(css2);

			// 日期
			oDayCell.html(iIndex);
			oDayCell.attr("index", iIndex++);

			// 设置宽度
			if (j == (this.WeekTitles.length - 1)) {
				// 最后一列
				oDayCell.css({
					width : iLastColumnWidth + "px"
				});

			} else {
				// 前6列
				oDayCell.css({
					width : iColumnWidth + "px"
				});
			}

			// 间隔列
			if (j != (this.WeekTitles.length - 1)) {
				// 标题格子
				oWeekRow.append("<div />");
				var oDayBlank = oWeekRow.find(">div:last-child");
				// 设置样式
				oDayBlank.addClass("FHBaseUICalendarDayBlank").css(css3);
			}
		}
	}

};

/**
 * @描述：绘制组件
 * @开发人员：moshco zhu
 * @开发日期：2010-11-23 上午08:00:00
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUICalendar.prototype.paint = function() {

	// 目标对象
	var oTarget = this.Target;

	// 读取一个8位长的随机数
	var strCode = random(8);
	// 设置目标组件关连的选择器组件的编码
	oTarget.attr(FHBaseUICalendar.TARGET_ATTR_NAME_CODE, strCode);

	// 读取目标对象的高度
	var iTargetHeight = oTarget.outerHeight();
	// 读取目标对象的位置
	var oOffset = oTarget.offset();
	var iLeft = oOffset.left;
	var iTop = oOffset.top + iTargetHeight;

	// Body对象
	var oBody = $(window.document.body);

	// 绘制一个层对象
	oBody.append("<div />");
	var oContainer = oBody.find(">div:last-child");
	this.Container = oContainer;// 容器对象
	oContainer.addClass("FHBaseUICalendar").css({
		position : "absolute",
		left : iLeft + "px",
		top : iTop + "px",
		"z-index" : 0
	});
	// 设置编码属性
	oContainer.attr(FHBaseUICalendar.ATTR_NAME_CODE, strCode);

	// 读取容器的尺寸
	var iWidth = oContainer.width();

	// 第一行 顶部边线
	oContainer.append("<div />");
	var oTop = oContainer.find(">div:last-child");
	// 设置样式
	oTop.addClass("FHBaseUICalendarTop").css({
		position : "static",
		float : "left",
		width : iWidth + "px",
		clear : "both",
		overflow : "hidden"
	});
	// 读取高度
	var iTopHeight = oTop.height();

	// 绘制中部
	var iPaddingLeft = 5;
	var iPaddingTop = 2;
	var iPaddingBottom = 2;

	// 中部
	oContainer.append("<div />");
	var oMid = oContainer.find(">div:last-child");
	// 设置样式
	oMid.addClass("FHBaseUICalendarMid").css({
		position : "static",
		float : "left",
		width : (iWidth - 2 * iPaddingLeft) + "px",
		"padding-left" : iPaddingLeft + "px",
		"padding-top" : iPaddingTop + "px",
		"padding-bottom" : iPaddingBottom + "px",
		clear : "both"
	});

	// 绘制中部
	this.paintMid(oMid);

	// 底部
	oContainer.append("<div />");
	var oBottom = oContainer.find(">div:last-child");
	// 设置样式
	oBottom.addClass("FHBaseUICalendarBottom").css({
		position : "static",
		float : "left",
		width : (iWidth - 2 * iPaddingLeft) + "px",
		"padding-left" : iPaddingLeft + "px",
		clear : "both"
	});

	// 绘制底部
	this.paintBottom(oBottom);
};

// 对话框的默认宽度
FHBaseUIDialog.DIALOG_DEFAULT_WIDTH = 320;

/**
 * @描述：基础UI组件之 消息对话框
 * @开发人员：moshco zhu1
 * @开发日期：2010-8-15 下午02:18:26
 * @参数：enclosing_method_arguments
 * @返回值：return_type
 */
function FHBaseUIDialog(oContainer, oCoverContainer) {
	// 扩展基础组件对象
	var oComponentClass = {};
	$.extend(oComponentClass, FHBase);
	$.extend(oComponentClass, FHBaseUIDialog);
	$.extend(FHBaseUIDialog, oComponentClass);
	var oComponent = {};
	$.extend(oComponent, FHBASE);
	$.extend(oComponent, this);
	$.extend(this, oComponent);
	// 容器
	this.Container = oContainer;
	// 被覆盖容器
	if (oCoverContainer == null) {
		this.CoverContainer = $(document.body);
	} else {
		this.CoverContainer = oCoverContainer;
	}
};

// 容器
FHBaseUIDialog.prototype.Container = null;

// 被覆盖容器
FHBaseUIDialog.prototype.CoverContainer = null;

/**
 * @描述：显示一个查询列表模式对话框
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-11 下午06:39:36
 * @参数：oParam
 * @返回值：any
 * @param oParam
 * @return
 */
FHBaseUIDialog.prototype.mlistDialog = function(oParam) {
	// 对象别名
	var oThis = this;
	// 删除之前的内容
	if (this.Container != null) {
		this.Container.empty();
	}

	// 背景的尺寸
	var iWidth = this.CoverContainer.outerWidth();
	var iHeight = this.CoverContainer.outerHeight();
	// 偏移
	var oOffset = this.CoverContainer.offset();

	// 背景层
	this.Container.append("<div />");
	var oCover = this.Container.find(">div:last-child");
	// 设置样式
	oCover.addClass("FHBaseUIDialogCover").css({
		position : "absolute",
		left : oOffset.left + "px",
		top : oOffset.top + "px",
		"margin-left" : "0px",
		"margin-top" : "0px",
		"opacity" : 0.5,
		filter : "alpha(opacity = 50)",
		width : iWidth + "px",
		height : iHeight + "px",
		border : "0px #FF0000 solid"
	});

	// 绘制一个表单对话框
	var oDialog = this.paintDialog(this.Container, oParam);
	// 绘制表单内容
	if (oParam.fnPaintFormList != null) {
		// 中间部分
		var oPanelMid = oDialog.find(".FHBaseUIDialogPanelMid");
		oParam.fnPaintFormList(oPanelMid);

		// 设置对话框高度
		var iPanelMidHeight = oPanelMid.outerHeight();
		if (iPanelMidHeight < 80) {
			iPanelMidHeight = 80;
		}
		oDialog.find(".FHBaseUIDialogPanel").height(iPanelMidHeight);
		oDialog.find(".FHBaseUIDialogPanelLeft").height(iPanelMidHeight);
		oDialog.find(".FHBaseUIDialogPanelMid").height(iPanelMidHeight);
		oDialog.find(".FHBaseUIDialogPanelRight").height(iPanelMidHeight);
	}

	// 设置关闭按钮的事件
	oDialog.find(".FHBaseUIDialogTitleMidClose").click(function() {
		oThis.close();
	});

	// 设置位置
	var iMsgWidth = oDialog.outerWidth();
	var iMsgHeight = oDialog.outerHeight();
	var iMarginLeft = parseInt((iWidth - iMsgWidth) / 2);
	var iMarginTop = parseInt((iHeight - iMsgHeight) / 2) - 100;
	oDialog.css({
		left : oOffset.left + "px",
		top : oOffset.top + "px",
		"margin-left" : iMarginLeft + "px",
		"margin-top" : iMarginTop + "px"
	});

};

/**
 * @描述：绘制模式对话框
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-12 下午06:01:00
 * @参数：fnPaintForm, oParam
 * @返回值：any
 * @param fnPaintForm
 * @param oParam
 * @return
 */
FHBaseUIDialog.prototype.mformDialog = function(fnPaintForm, oParam) {
	// 对象别名
	var oThis = this;
	// 删除之前的内容
	if (this.Container != null) {
		this.Container.empty();
	}

	// 背景的尺寸
	var iWidth = this.CoverContainer.outerWidth();
	var iHeight = this.CoverContainer.outerHeight();
	// 偏移
	var oOffset = this.CoverContainer.offset();

	// 背景层
	this.Container.append("<div />");
	var oCover = this.Container.find(">div:last-child");
	// 设置样式
	oCover.addClass("FHBaseUIDialogCover").css({
		position : "absolute",
		left : oOffset.left + "px",
		top : oOffset.top + "px",
		"margin-left" : "0px",
		"margin-top" : "0px",
		"opacity" : 0.5,
		filter : "alpha(opacity = 50)",
		width : iWidth + "px",
		height : iHeight + "px",
		border : "0px #FF0000 solid"
	});

	// 是否需要绘制框架
	var bIsPaintFrame = ((oParam == null) || (oParam.isPaintFrame == null)) ? true : oParam.isPaintFrame;
	var oDialog = null;
	if (bIsPaintFrame) {
		// 绘制一个表单对话框
		oDialog = this.paintDialog(this.Container, oParam);
	} else {
		// 绘制外框容器
		oDialog = this.paintNoBorderDialog(this.Container, oParam);
	}

	// 绘制表单内容
	if (fnPaintForm != null) {
		// 中间部分
		var oPanelMid = oDialog.find(".FHBaseUIDialogPanelMid");
		fnPaintForm(oPanelMid);

		// 设置对话框宽度
		if (!bIsPaintFrame) {
			var oContent = oPanelMid.find(">div:last-child");
			var iDialogWidth = oContent.outerWidth();
			oDialog.find(".FHBaseUIDialogPanelMid").width(iDialogWidth);
			oDialog.find(">div").width(iDialogWidth);
			oDialog.width(iDialogWidth);
		}

		// 设置对话框高度
		var iPanelMidHeight = oPanelMid.outerHeight();
		if (iPanelMidHeight < 80) {
			iPanelMidHeight = 80;
		}
		oDialog.find(".FHBaseUIDialogPanel").height(iPanelMidHeight);
		oDialog.find(".FHBaseUIDialogPanelLeft").height(iPanelMidHeight);
		oDialog.find(".FHBaseUIDialogPanelMid").height(iPanelMidHeight);
		oDialog.find(".FHBaseUIDialogPanelRight").height(iPanelMidHeight);
	}

	// 设置位置
	var iMsgWidth = oDialog.outerWidth();
	var iMsgHeight = oDialog.outerHeight();
	var iMarginLeft = parseInt((iWidth - iMsgWidth) / 2);
	var iMarginTop = parseInt((iHeight - iMsgHeight) / 2) - 100;
	oDialog.css({
		left : oOffset.left + "px",
		top : oOffset.top + "px",
		"margin-left" : iMarginLeft + "px",
		"margin-top" : iMarginTop + "px"
	});

	// 设置关闭按钮的事件
	oDialog.find(".FHBaseUIDialogTitleMidClose").click(function() {
		oThis.close();
	});

	// 设置提交按钮 事件
	oDialog.find(".dialog_submit").click(function() {
		var oFormDiv = oThis.Container.find(".FHBaseUIDialogPanelMid");
		oThis.submitForm(oParam, oFormDiv);
	});

	// 设置取消按钮 事件
	oDialog.find(".dialog_cancel").click(function() {
		oThis.close();
	});
};

/**
 * @描述：提交表单事件
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-12 下午08:07:31
 * @参数：oParam, oFormDiv
 * @返回值：any
 * @param oParam
 * @param oFormDiv
 * @return
 */
FHBaseUIDialog.prototype.submitForm = function(oParam, oFormDiv) {
	// 对象别名
	var oThis = this;
	// 提交前事件函数
	var bIsContinue = false;
	var oFormData = null;
	if (oParam != null && oParam.on_before_submit != null) {
		// 读取表单数据
		var oFormData = this.getFormData(oFormDiv);
		// 提交前运行
		bIsContinue = oParam.on_before_submit(oFormData, oFormDiv);
		if (bIsContinue == null) {
			bIsContinue = true;
		}
	}
	// 提交表单
	var strActionUrl = oParam.actionUrl;
	if (bIsContinue && oParam != null && strActionUrl != null && strActionUrl != "") {
		// 异步函数
		var fn = function(strJs) {
			if (oParam != null && oParam.on_after_submit != null) {
				// 提交后事件
				var bIsClose = oParam.on_after_submit(strJs);
				if (bIsClose == null || bIsClose) {
					oThis.close();
				}
			} else {
				oThis.close();
			}
		};
		// 提交表单
		doAction(strActionUrl, oFormData, fn);
	}
};

/**
 * @描述:绘制对话框
 * @开发人员:moshco zhu
 * @开发时间:2011-5-28 上午01:32:27
 * @param strMsg
 * @param strBtnTitle
 * @param fn
 * @param bIsModal
 */
FHBaseUIDialog.prototype.dialog = function(strMsg, strBtnTitle, fn, bIsModal, bIsBorder) {
	// 是否模式对话框
	if (bIsModal == null) {
		bIsModal = false;
	}

	// 对象别名
	var oThis = this;
	// 删除之前的内容
	if (this.Container != null) {
		this.Container.empty();
	}

	// 背景的尺寸
	var iWidth = this.CoverContainer.outerWidth();
	var iHeight = this.CoverContainer.outerHeight();
	// 偏移
	var oOffset = this.CoverContainer.offset();

	// 背景
	if (bIsModal) {
		// 背景层
		this.Container.append("<div />");
		var oCover = this.Container.find(">div:last-child");
		// 设置样式
		oCover.addClass("FHBaseUIDialogCover").css({
			position : "absolute",
			left : oOffset.left + "px",
			top : oOffset.top + "px",
			"margin-left" : "0px",
			"margin-top" : "0px",
			"opacity" : 0.5,
			filter : "alpha(opacity = 50)",
			width : iWidth + "px",
			height : iHeight + "px",
			border : "0px #FF0000 solid"
		});
	}

	// 绘制一个消息对话框
	var oMsgDialog = null;
	if (bIsBorder == null || bIsBorder) {
		oMsgDialog = this.paintDialog(this.Container);
	} else {
		oMsgDialog = this.paintNoBorderDialog(this.Container);
	}
	// 设置内容
	this.setMsg(oMsgDialog, strMsg, strBtnTitle, fn);

	// 设置关闭按钮的事件
	oMsgDialog.find(".FHBaseUIDialogTitleMidClose").click(function() {
		oThis.close();
	});

	// 设置位置
	var iMsgWidth = oMsgDialog.outerWidth();
	var iMsgHeight = oMsgDialog.outerHeight();
	var iMarginLeft = parseInt((iWidth - iMsgWidth) / 2);
	var iMarginTop = parseInt((iHeight - iMsgHeight) / 2);
	oMsgDialog.css({
		left : oOffset.left + "px",
		top : oOffset.top + "px",
		"margin-left" : iMarginLeft + "px",
		"margin-top" : iMarginTop + "px"
	});
	// 返回函数值
	return this;
};

/**
 * @描述:显示一个模式无边界对话框
 * @开发人员:moshco zhu
 * @开发时间:2011-5-28 上午02:14:11
 * @param strMsg
 * @param strBtnTitle
 * @param fn
 * @returns
 */
FHBaseUIDialog.prototype.mNoBorderDialog = function(strMsg, strBtnTitle, fn) {
	return this.dialog(strMsg, strBtnTitle, fn, true, false);
};

/**
 * @描述:显示一个非模式对话框
 * @开发人员:moshco zhu
 * @开发时间:2011-5-28 上午01:32:48
 * @param strMsg
 * @param strBtnTitle
 * @param fn
 */
FHBaseUIDialog.prototype.nmdialog = function(strMsg, strBtnTitle, fn) {
	return this.dialog(strMsg, strBtnTitle, fn, false);
};

/**
 * @描述:显示一个模式对话框
 * @开发人员:moshco zhu
 * @开发时间:2011-5-28 上午01:33:20
 * @param strMsg
 * @param strBtnTitle
 * @param fn
 */
FHBaseUIDialog.prototype.mdialog = function(strMsg, strBtnTitle, fn) {
	return this.dialog(strMsg, strBtnTitle, fn, true);
};

/**
 * @描述:隐藏按钮
 * @开发人员:moshco zhu
 * @开发时间:2011-5-26 下午12:08:08
 * @returns {FHBaseUIDialog}
 */
FHBaseUIDialog.prototype.hideButton = function() {
	// 中间部分
	var oPanelMid = this.Container.find(".FHBaseUIDialogPanelMid");
	var oMidButtonGroup = oPanelMid.find(".FHBaseUIDialogPanelMidButtonGroup");
	var iMidButtonGroupHeight = oMidButtonGroup.outerHeight();
	oMidButtonGroup.hide(0);
	// 设置对话框高度
	var iPanelMidHeight = oPanelMid.outerHeight();
	if (iPanelMidHeight < 80) {
		iPanelMidHeight = 80;
	} else {
		iPanelMidHeight -= iMidButtonGroupHeight;
	}
	// 重新设置面板尺寸
	this.Container.find(".FHBaseUIDialogPanel").height(iPanelMidHeight);
	this.Container.find(".FHBaseUIDialogPanelLeft").height(iPanelMidHeight);
	this.Container.find(".FHBaseUIDialogPanelMid").height(iPanelMidHeight);
	this.Container.find(".FHBaseUIDialogPanelRight").height(iPanelMidHeight);
	// 返回函数值
	return this;
};

/**
 * @描述:隐藏关闭
 * @开发人员:moshco zhu
 * @开发时间:2011-5-27 上午10:10:53
 * @returns {FHBaseUIDialog}
 */
FHBaseUIDialog.prototype.hideClose = function() {
	this.Container.find(".FHBaseUIDialogTitleMidClose").fadeOut(0);
	return this;
};

/**
 * @描述:显示关闭
 * @开发人员:moshco zhu
 * @开发时间:2011-5-27 上午10:10:53
 * @returns {FHBaseUIDialog}
 */
FHBaseUIDialog.prototype.showClose = function() {
	this.Container.find(".FHBaseUIDialogTitleMidClose").fadeIn(0);
	return this;
};

/**
 * @描述：设置标题
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-11 下午05:21:24
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIDialog.prototype.setTitle = function(strTitle) {
	this.Container.find(".FHBaseUIDialogTitleMidText").html(strTitle);
	return this;
};

/**
 * @描述:设置图标
 * @开发人员:moshco zhu
 * @开发时间:2011-5-26 上午11:47:39
 * @param strTitleClass
 * @returns {FHBaseUIDialog}
 */
FHBaseUIDialog.prototype.setTitleIcon = function(strTitleClass) {
	this.Container.find(".FHBaseUIDialogTitleMidIcon").addClass(strTitleClass);
	return this;
};

/**
 * @描述：设置顶部偏移
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-11 下午05:56:26
 * @参数：iMarginTop
 * @返回值：any
 */
FHBaseUIDialog.prototype.setMarginTop = function(iMarginTop) {
	this.Container.find(".FHBaseUIDialog").css({
		"margin-top" : iMarginTop + "px"
	});
	return this;
};

/**
 * @描述：设置左边偏移
 * @开发人员：moshco zhu
 * @开发时间：2011-5-26 下午01:02:15
 */
FHBaseUIDialog.prototype.setMarginLeft = function(iMarginLeft) {
	this.Container.find(".FHBaseUIDialog").css({
		"margin-left" : iMarginLeft + "px"
	});
	return this;
};

/**
 * @描述:对话框初始化
 * @开发人员:moshco zhu
 * @开发时间:2011-5-30 上午01:09:08
 * @param fnInit
 */
FHBaseUIDialog.prototype.init = function(fnInit) {
	if (fnInit != null) {
		fnInit(this.Container);
	}
	return this;
};

/**
 * @描述:设置宽度
 * @开发人员:moshco zhu
 * @开发时间:2011-5-28 上午01:16:56
 * @param iWidth
 */
FHBaseUIDialog.prototype.setWidth = function(iWidth, bIsModifyMargin) {
	// 对话框对象
	var oDialog = this.Container.find(".FHBaseUIDialog");
	oDialog.width(iWidth);
	// 标题
	var oTitle = oDialog.find(".FHBaseUIDialogTitle");
	oTitle.width(iWidth);
	var oTitleLeft = oTitle.find(".FHBaseUIDialogTitleLeft");
	var oTitleMid = oTitle.find(".FHBaseUIDialogTitleMid");
	var oTitleMidIcon = oTitle.find(".FHBaseUIDialogTitleMidIcon");
	var oTitleMidText = oTitle.find(".FHBaseUIDialogTitleMidText");
	var oTitleMidClose = oTitle.find(".FHBaseUIDialogTitleMidClose");
	var oTitleRight = oTitle.find(".FHBaseUIDialogTitleRight");
	oTitleMid.width(iWidth - oTitleLeft.outerWidth() - oTitleRight.outerWidth());
	oTitleMidText.width(iWidth - oTitleLeft.outerWidth() - oTitleMidIcon.outerWidth() - oTitleMidClose.outerWidth() - oTitleRight.outerWidth());

	// 内容信息
	var oPanel = oDialog.find(".FHBaseUIDialogPanel");
	oPanel.width(iWidth);
	var oPanelLeft = oDialog.find(".FHBaseUIDialogPanelLeft");
	var oPanelMid = oDialog.find(".FHBaseUIDialogPanelMid");
	var oPanelRight = oDialog.find(".FHBaseUIDialogPanelRight");
	oPanelMid.width(iWidth - oPanelLeft.outerWidth() - oPanelRight.outerWidth());

	// 页脚
	var oFooter = oDialog.find(".FHBaseUIDialogFooter");
	oFooter.width(iWidth);
	var oFooterLeft = oDialog.find(".FHBaseUIDialogFooterLeft");
	var oFooterMid = oDialog.find(".FHBaseUIDialogFooterMid");
	var oFooterRight = oDialog.find(".FHBaseUIDialogFooterRight");
	oFooterMid.width(iWidth - oFooterLeft.outerWidth() - oFooterRight.outerWidth());

	// 偏移居中
	if (bIsModifyMargin == null || bIsModifyMargin) {
		// 背景的尺寸
		var iWidth = this.CoverContainer.outerWidth();
		var iHeight = this.CoverContainer.outerHeight();
		// 偏移
		var oOffset = this.CoverContainer.offset();
		// 设置位置
		var iMsgWidth = oDialog.outerWidth();
		var iMsgHeight = oDialog.outerHeight();
		var iMarginLeft = parseInt((iWidth - iMsgWidth) / 2);
		var iMarginTop = parseInt((iHeight - iMsgHeight) / 2);
		oDialog.css({
			left : oOffset.left + "px",
			top : oOffset.top + "px",
			"margin-left" : iMarginLeft + "px",
			"margin-top" : iMarginTop + "px"
		});
	}
	// 返回函数值
	return this;
};

/**
 * @描述：设置高度
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-12 上午12:03:53
 * @参数：iHeight
 * @返回值：any
 * @param iHeight
 * @return
 */
FHBaseUIDialog.prototype.setHeight = function(iHeight) {
	var oDialog = this.Container.find(".FHBaseUIDialog");
	oDialog.find(".FHBaseUIDialogPanel").height(iHeight);
	oDialog.find(".FHBaseUIDialogPanelLeft").height(iHeight);
	oDialog.find(".FHBaseUIDialogPanelMid").height(iHeight);
	oDialog.find(".FHBaseUIDialogPanelRight").height(iHeight);
	// 返回函数值
	return this;
};

/**
 * @描述：绘制无边界对话框
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-12 下午06:13:26
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIDialog.prototype.paintNoBorderDialog = function(oContainer, oParam) {
	// 对话框宽度
	var iDialogWidth = FHBaseUIDialog.DIALOG_DEFAULT_WIDTH;
	if (oParam != null && oParam.width != null) {
		iDialogWidth = oParam.width;
	}

	// 对话框
	oContainer.append("<div />");
	var oDialog = oContainer.find(">div:last-child");
	// 设置样式
	oDialog.addClass("FHBaseUIDialog").css({
		position : "absolute",
		width : iDialogWidth + "px"
	});

	// 标题行
	oDialog.append("<div />");
	var oTitleRow = oDialog.find(">div:last-child");
	oTitleRow.width(iDialogWidth).addClass("FHBaseUIDialogTitle").css({
		position : "static",
		float : "left",
		height : "0px",
		overflow : "hidden",
		clear : "both"
	});
	var iTitleHeight = oTitleRow.height();
	// 左边
	oTitleRow.append("<div />");
	var oTitleLeft = oTitleRow.find(">div:last-child");
	oTitleLeft.addClass("FHBaseUIDialogTitleLeft").css({
		position : "static",
		float : "left",
		height : iTitleHeight + "px",
		overflow : "hidden"
	});
	var iTitleLeftWidth = oTitleLeft.width();
	// 中间
	oTitleRow.append("<div />");
	var oTitleMid = oTitleRow.find(">div:last-child");
	oTitleMid.addClass("FHBaseUIDialogTitleMid").css({
		position : "static",
		float : "left",
		height : iTitleHeight + "px",
		overflow : "hidden"
	});
	// 中间 标题文本
	oTitleMid.append("<div />");
	var oTitleMidText = oTitleMid.find(">div:last-child");
	oTitleMidText.addClass("FHBaseUIDialogTitleMidText").css({
		position : "static",
		float : "left",
		height : iTitleHeight + "px",
		"line-height" : iTitleHeight + "px",
		overflow : "hidden"
	});
	// 中间 关闭图标
	oTitleMid.append("<div />");
	var oTitleMidClose = oTitleMid.find(">div:last-child");
	oTitleMidClose.addClass("FHBaseUIDialogTitleMidClose").css({
		position : "static",
		float : "right",
		height : iTitleHeight + "px",
		overflow : "hidden"
	});
	var iTitleMidClose = oTitleMidClose.outerWidth();
	// 右边
	oTitleRow.append("<div />");
	var oTitleRight = oTitleRow.find(">div:last-child");
	oTitleRight.addClass("FHBaseUIDialogTitleRight").css({
		position : "static",
		float : "right",
		height : iTitleHeight + "px",
		overflow : "hidden"
	});
	var iTitleRightWidth = oTitleRight.width();
	// 中间宽度
	var iTitleMidWidth = iDialogWidth - iTitleLeftWidth - iTitleRightWidth;
	oTitleMid.css({
		width : iTitleMidWidth + "px"
	});
	// 中间文本宽度
	var iTitleMidTextWidth = iTitleMidWidth - iTitleMidClose;
	oTitleMidText.css({
		width : iTitleMidTextWidth + "px"
	});

	// 内容面板
	oDialog.append("<div />");
	var oPanelRow = oDialog.find(">div:last-child");
	oPanelRow.width(iDialogWidth).addClass("FHBaseUIDialogPanel").css({
		position : "static",
		float : "left"
	});
	// 左边
	oPanelRow.append("<div />");
	var oPanelLeft = oPanelRow.find(">div:last-child");
	oPanelLeft.addClass("FHBaseUIDialogPanelLeft").css({
		position : "static",
		float : "left",
		width : "0px",
		overflow : "hidden"
	});
	var oPanelLeftWidth = oPanelLeft.width();
	// 中间
	oPanelRow.append("<div />");
	var oPanelMid = oPanelRow.find(">div:last-child");
	oPanelMid.addClass("FHBaseUIDialogPanelMid").css({
		position : "static",
		float : "left"
	});
	// 右边
	oPanelRow.append("<div />");
	var oPanelRight = oPanelRow.find(">div:last-child");
	oPanelRight.addClass("FHBaseUIDialogPanelRight").css({
		position : "static",
		float : "right",
		width : "0px",
		overflow : "hidden"
	});
	var iPanelRowRightWidth = oPanelRight.width();
	// 中间宽度
	oPanelMid.css({
		width : (iDialogWidth - oPanelLeftWidth - iPanelRowRightWidth) + "px"
	});

	// 页脚行
	oDialog.append("<div />");
	var oFooterRow = oDialog.find(">div:last-child");
	oFooterRow.width(iDialogWidth).addClass("FHBaseUIDialogFooter").css({
		position : "static",
		float : "left",
		height : "0px",
		overflow : "hidden",
		clear : "both"
	});
	var iFooterHeight = oFooterRow.height();
	// 左边
	oFooterRow.append("<div />");
	var oFooterLeft = oFooterRow.find(">div:last-child");
	oFooterLeft.addClass("FHBaseUIDialogFooterLeft").css({
		position : "static",
		float : "left",
		height : iFooterHeight + "px",
		overflow : "hidden"
	});
	var iFooterLeftWidth = oFooterLeft.width();
	// 中间
	oFooterRow.append("<div />");
	var oFooterMid = oFooterRow.find(">div:last-child");
	oFooterMid.addClass("FHBaseUIDialogFooterMid").css({
		position : "static",
		float : "left",
		height : iFooterHeight + "px",
		overflow : "hidden"
	});
	// 右边
	oFooterRow.append("<div />");
	var oFooterRight = oFooterRow.find(">div:last-child");
	oFooterRight.addClass("FHBaseUIDialogFooterRight").css({
		position : "static",
		float : "right",
		height : iFooterHeight + "px",
		overflow : "hidden"
	});
	var iFooterRightWidth = oFooterRight.width();
	// 中间宽度
	oFooterMid.css({
		width : (iDialogWidth - iFooterLeftWidth - iFooterRightWidth) + "px"
	});

	// 返回函数值
	return oDialog;
};

/**
 * @描述：绘制对话框
 * @开发人员：moshco zhu1
 * @开发日期：2010-9-11 下午07:20:15
 * @参数：oContainer, oParam
 * @返回值：any
 * @param oContainer
 * @param oParam
 * @return
 */
FHBaseUIDialog.prototype.paintDialog = function(oContainer, oParam) {
	// 对话框宽度
	var iDialogWidth = FHBaseUIDialog.DIALOG_DEFAULT_WIDTH;
	if (oParam != null && oParam.width != null) {
		iDialogWidth = oParam.width;
	}

	// 对话框
	oContainer.append("<div />");
	var oDialog = oContainer.find(">div:last-child");
	// 设置样式
	oDialog.addClass("FHBaseUIDialog").css({
		position : "absolute",
		width : iDialogWidth + "px",
		overflow : "hidden"
	});

	// 标题行
	oDialog.append("<div />");
	var oTitleRow = oDialog.find(">div:last-child");
	oTitleRow.width(iDialogWidth).addClass("FHBaseUIDialogTitle").css({
		position : "static",
		float : "left",
		clear : "both"
	});
	var iTitleHeight = oTitleRow.height();
	// 左边
	oTitleRow.append("<div />");
	var oTitleLeft = oTitleRow.find(">div:last-child");
	oTitleLeft.addClass("FHBaseUIDialogTitleLeft").css({
		position : "static",
		float : "left",
		height : iTitleHeight + "px"
	});
	var iTitleLeftWidth = oTitleLeft.width();
	// 中间
	oTitleRow.append("<div />");
	var oTitleMid = oTitleRow.find(">div:last-child");
	oTitleMid.addClass("FHBaseUIDialogTitleMid").css({
		position : "static",
		float : "left",
		height : iTitleHeight + "px"
	});
	// 中间 标题图标
	oTitleMid.append("<div />");
	var oTitleMidIcon = oTitleMid.find(">div:last-child");
	oTitleMidIcon.addClass("FHBaseUIDialogTitleMidIcon").css({
		position : "static",
		float : "left",
		height : iTitleHeight + "px",
		"line-height" : iTitleHeight + "px",
		overflow : "hidden"
	});
	var iTitleMidIcon = oTitleMidIcon.outerWidth();

	// 中间 标题文本
	oTitleMid.append("<div />");
	var oTitleMidText = oTitleMid.find(">div:last-child");
	oTitleMidText.addClass("FHBaseUIDialogTitleMidText").css({
		position : "static",
		float : "left",
		height : iTitleHeight + "px",
		"line-height" : iTitleHeight + "px",
		overflow : "hidden"
	});
	// 中间 关闭图标
	oTitleMid.append("<div />");
	var oTitleMidClose = oTitleMid.find(">div:last-child");
	oTitleMidClose.addClass("FHBaseUIDialogTitleMidClose").css({
		position : "static",
		float : "right",
		height : iTitleHeight + "px"
	});
	var iTitleMidClose = oTitleMidClose.outerWidth();
	// 右边
	oTitleRow.append("<div />");
	var oTitleRight = oTitleRow.find(">div:last-child");
	oTitleRight.addClass("FHBaseUIDialogTitleRight").css({
		position : "static",
		float : "right",
		height : iTitleHeight + "px"
	});
	var iTitleRightWidth = oTitleRight.width();
	// 中间宽度
	var iTitleMidWidth = iDialogWidth - iTitleLeftWidth - iTitleRightWidth;
	oTitleMid.css({
		width : iTitleMidWidth + "px"
	});
	// 中间文本宽度
	var iTitleMidTextWidth = iTitleMidWidth - iTitleMidClose - iTitleMidIcon;
	oTitleMidText.css({
		width : iTitleMidTextWidth + "px"
	});

	// 信息显示行
	oDialog.append("<div />");
	var oPanelRow = oDialog.find(">div:last-child");
	oPanelRow.width(iDialogWidth).addClass("FHBaseUIDialogPanel").css({
		position : "static",
		float : "left"
	});
	// 左边
	oPanelRow.append("<div />");
	var oPanelLeft = oPanelRow.find(">div:last-child");
	oPanelLeft.addClass("FHBaseUIDialogPanelLeft").css({
		position : "static",
		float : "left"
	});
	var oPanelLeftWidth = oPanelLeft.width();
	// 中间
	oPanelRow.append("<div />");
	var oPanelMid = oPanelRow.find(">div:last-child");
	oPanelMid.addClass("FHBaseUIDialogPanelMid").css({
		position : "static",
		float : "left"
	});
	// 右边
	oPanelRow.append("<div />");
	var oPanelRight = oPanelRow.find(">div:last-child");
	oPanelRight.addClass("FHBaseUIDialogPanelRight").css({
		position : "static",
		float : "right"
	});
	var iPanelRowRightWidth = oPanelRight.width();
	// 中间宽度
	oPanelMid.css({
		width : (iDialogWidth - oPanelLeftWidth - iPanelRowRightWidth) + "px"
	});

	// 页脚行
	oDialog.append("<div />");
	var oFooterRow = oDialog.find(">div:last-child");
	oFooterRow.width(iDialogWidth).addClass("FHBaseUIDialogFooter").css({
		position : "static",
		float : "left",
		clear : "both"
	});
	var iFooterHeight = oFooterRow.height();
	// 左边
	oFooterRow.append("<div />");
	var oFooterLeft = oFooterRow.find(">div:last-child");
	oFooterLeft.addClass("FHBaseUIDialogFooterLeft").css({
		position : "static",
		float : "left",
		height : iFooterHeight + "px"
	});
	var iFooterLeftWidth = oFooterLeft.width();
	// 中间
	oFooterRow.append("<div />");
	var oFooterMid = oFooterRow.find(">div:last-child");
	oFooterMid.addClass("FHBaseUIDialogFooterMid").css({
		position : "static",
		float : "left",
		height : iFooterHeight + "px"
	});
	// 右边
	oFooterRow.append("<div />");
	var oFooterRight = oFooterRow.find(">div:last-child");
	oFooterRight.addClass("FHBaseUIDialogFooterRight").css({
		position : "static",
		float : "right",
		height : iFooterHeight + "px"
	});
	var iFooterRightWidth = oFooterRight.width();
	// 中间宽度
	oFooterMid.css({
		width : (iDialogWidth - iFooterLeftWidth - iFooterRightWidth) + "px"
	});

	// 返回函数值
	return oDialog;
};

/**
 * @描述：设置消息内容
 * @开发人员：moshco zhu1
 * @开发日期：2010-8-15 下午02:48:06
 * @参数：oDialog, strMsg, strBtnTitle, fn
 * @返回值：any
 * @param oDialog
 * @param strMsg
 * @param strBtnTitle
 * @param fn
 * @return
 */
FHBaseUIDialog.prototype.setMsg = function(oDialog, strMsg, strBtnTitle, fn) {
	// 中间部分
	var oPanelMid = oDialog.find(".FHBaseUIDialogPanelMid");
	var iPanelMidWidth = oPanelMid.width();

	// 内容面板消息内容部分
	oPanelMid.append("<div />");
	var oMsgContent = oPanelMid.find(">div:last-child");
	oMsgContent.addClass("FHBaseUIDialogPanelMidMsgContent").css({
		position : "static",
		float : "left",
		clear : "both"
	});
	var iPaddingLeft = parseInt(oMsgContent.css("padding-left"));
	var iPaddingRight = parseInt(oMsgContent.css("padding-right"));
	oMsgContent.width(iPanelMidWidth - iPaddingLeft - iPaddingRight);
	// 设置内容
	oMsgContent.html(strMsg);

	// 按钮组
	oPanelMid.append("<div />");
	var oButtonGroup = oPanelMid.find(">div:last-child");
	oButtonGroup.attr("align", "left");
	oButtonGroup.addClass("FHBaseUIDialogPanelMidButtonGroup").css({
		position : "static",
		float : "left",
		clear : "both"
	});
	oButtonGroup.width(iPanelMidWidth);

	// 添加按钮
	if (strBtnTitle instanceof Array) {
		// 多个按钮
	} else if ((typeof (strBtnTitle) == "string") || strBtnTitle == null || strBtnTitle == "") {
		// 单个按钮
		if (strBtnTitle == null || strBtnTitle == "") {
			strBtnTitle = "关闭";
		}
		oButtonGroup.append("<div />");
		var oButton = oButtonGroup.find("div:last-child");
		if (strBtnTitle.length <= 2) {
			oButton.addClass("FHBaseUIDialogPanelMidButton1").css({
				position : "static"
			});
		} else if (strBtnTitle.length <= 4) {
			oButton.addClass("FHBaseUIDialogPanelMidButton2").css({
				position : "static"
			});
		} else if (strBtnTitle.length <= 6) {
			oButton.addClass("FHBaseUIDialogPanelMidButton3").css({
				position : "static"
			});
		} else if (strBtnTitle.length > 6) {
			oButton.addClass("FHBaseUIDialogPanelMidButton3").css({
				position : "static"
			});
		}
		oButton.html(strBtnTitle);
		var iBtnWidth = oButton.width();
		// 设置偏移
		oButton.css({
			"margin-left" : ((iPanelMidWidth - iBtnWidth) / 2) + "px"
		});

		// 设置按钮的单击事件
		var oThis = this;
		oButton.click(function() {
			oThis.Container.empty();
			if (fn != null) {
				fn();
			}
		});
	}

	// 设置对话框高度
	var iPanelMidHeight = oPanelMid.outerHeight();
	if (iPanelMidHeight < 80) {
		iPanelMidHeight = 80;
	}
	oDialog.find(".FHBaseUIDialogPanel").height(iPanelMidHeight);
	oDialog.find(".FHBaseUIDialogPanelLeft").height(iPanelMidHeight);
	oDialog.find(".FHBaseUIDialogPanelMid").height(iPanelMidHeight);
	oDialog.find(".FHBaseUIDialogPanelRight").height(iPanelMidHeight);
};

/**
 * @描述：关闭对话框
 * @开发人员：moshco zhu1
 * @开发日期：2010-8-16 下午03:42:25
 * @参数：
 * @返回值：any
 * @return
 */
FHBaseUIDialog.prototype.close = function() {
	this.Container.empty();
};
