//-----------Top Path-----------
  //路徑鈕 註冊的function
function main_PathRtuModule_click(that)
{
	var Class = new Path();
	Class.ClearTheDivOfTheTail(that, "#Main_Top-Path");
	$("#Main_Left-List").css("display", "block");
	Class = new RtuModuleSecondPage();
	Class.NoConfirmButton();
	Class = null;
}
//-----------Left List-----------
function main_RtuModule_click(that)
{
	var LeftDivId="#Main_Left-List";
	var Class = new ListCommon();
	Class.ChangeDivCss(that, LeftDivId);
	Class = new Path();
	Class.LoadPathHtml($(that).text(), 1, "main_PathRtuModule_click(this)");
	Class = new LoadHtml();
	var Html = Class.GetVariableTranslationHtml(Global_RtuModuleCss);
	Html = Html + Class.GetVariableTranslationHtml(Global_RtuModuleFirstPageHtml);
	Html = Html + Class.GetVariableTranslationHtml(Global_RtuModuleSecondPageHtml);
	$("#Main_Center-Content").empty();
	$("#Main_Center-Content").append(Html);
	Class = new RtuModuleFirstPage();
	Class.Initialization();
	Class = null;
}
//-----------Center-----------
//__________RTU模組__________
  //第一頁
function main_RtuModuleSaveButton_click(that)
{
	var Class = new RtuModuleFirstPage();
	Class.SaveButton(that);
	Class = null;
}
function main_RtuModuleChangeAllCheckbox_click(that)
{
	var DataModelId = $(that).closest(".Table").attr("id");
	var Bool = $(that).closest(".Row").find(":checkbox").prop("checked");
	$("#"+DataModelId).find(".DynamicRow").find(":checkbox").prop("checked",Bool);
}
function main_RtuModuleAddNewRow_click(that)
{
	var Class = new RtuModuleFirstPage();
	Class.ModuleAddNewRow(that);
	Class = null;
}
function main_RtuModuleCopyDialogEnabled_click(that, Event)
{
	var Class = new RtuModuleFirstPage();
	if(Class.IsTickedModule() == false)
	{
		$(that).closest(".Column").find(".Message").eq(0).show();
		return 0;
	}
	$(that).closest(".Column").find(".Message").eq(0).hide();
	Class.CopyDialogEnabled(Event);
	Class = null;
}
function main_RtuModuleClearDialogEnabled_click(Event)
{
	var Class = new RtuModuleFirstPage();
	Class.ClearDialogEnabled(Event);
	Class = null;
}
function main_RtuModuleDeleteModule_click(that)
{
	var Class = new RtuModuleFirstPage();
	if(Class.IsTickedModule() == false)
	{
		$(that).closest(".Column").find(".Message").eq(0).show();
		return 0;
	}
	$(that).closest(".Column").find(".Message").eq(0).hide();
	Class.DeleteModule();
	Class = null;
}
function main_RtuModuleShowPreviousPage_click()
{
	var Class = new RtuModuleFirstPage();
	Class.ShowPreviousPage();
	Class = null;
}
function main_RtuModuleShowNextPage_click()
{
	var Class = new RtuModuleFirstPage();
	Class.ShowNextPage();
	Class = null;
}
function main_RtuModuleCopyModule_click()
{
	$(".Dialog").find(".Message").show();
	var Class = new RtuModuleFirstPage();
	Class.CopyModule();
	Class = null;
}
function main_RtuModuleCopyDialogDisabled_click()
{
	var Class = new RtuModuleFirstPage();
	Class.CopyDialogDisabled();
	Class = null;
}
function main_RtuModuleClearDialogDisabled_click()
{
	var Class = new RtuModuleFirstPage();
	Class.ClearDialogDisabled();
	Class = null;
}
function main_RtuModuleSettingButton_click(that)
{
	var Class = new RtuModuleFirstPage();
	Class.EditButton(that);
	Class = null;
}
function main_RtuModuleClearAllModule_click(that)
{
	var Class = new RtuModuleFirstPage();
	Class.ClearAllModule(that);
	Class = null;
}
function main_RtuModuleUpdateFile_click(that)
{
	var Class = new RtuModuleFirstPage();
	Class.UpdateFile(that);
	Class = null;
}

  //第二頁
function main_RtuModuleProduceTable_click(that)
{
	var Class = new RtuModuleSecondPage();
	Class.ProduceTable(that);
	Class = null;
}
function main_RtuModuleShowDataModeTable_click(TableId)
{
	$("#"+TableId).show();
}
function main_RtuModuleHideDataModeTable_click(TableId)
{
	if($("#"+TableId).find(".Message").is(":visible") == true){
		return 0;
	}
	$("#"+TableId).hide();
}
function main_RtuModuleChangeModbusTab_click(Mode, that)
{
	var Class = new RtuModuleSecondPage();
	Class.ChangeModbusTab(Mode, that);
	Class = null;
}
function main_RtuModuleOkButton_click(that)
{
	var Class = new RtuModuleSecondPage();
	Class.OkButton(that);
	Class = null;
}
function main_RtuModuleCancelButton_click(that)
{
	var Class = new RtuModuleSecondPage();
	Class.CancelButton(that);
	Class = null;
}
function main_RtuModuleEditButton_click(that)
{
	var Class = new RtuModuleSecondPage();
	Class.EditButton(that);
	Class = null;
}
function main_RtuModuleDeleteButton_click(that)
{
	var Class = new RtuModuleSecondPage();
	Class.DeleteButton(that);
	Class = null;
}
function main_RtuModuleConfirmButton_click(that)
{
	var Class = new RtuModuleSecondPage();
	Class.ConfirmButton(that);
	Class = null;
}
function main_RtuModuleNoConfirmButton_click()
{
	var Class = new RtuModuleSecondPage();
	Class.NoConfirmButton();
	Class = null;
}

function main_RtuModuleChangeRetryCss_click(that)
{
	var Class = new RtuModuleSecondPage();
	var Retry = $(that).closest(".Row").find(":checkbox").prop("checked");
	Class.ChangeRetryCss(Retry);
	Class = null;
}