//-----------Top Path-----------
function main_PathTcpModule_click(that)
{
	var Class = new Path();
	Class.ClearTheDivOfTheTail(that, "#Main_Top-Path");
	$("#Main_Left-List").css("display", "block");
	Class = new TcpModuleSecondPage();
	Class.NoConfirmButton();
	Class = null;
}
//-----------Left List-----------
function main_TcpModule_click(that)
{
	var LeftDivId="#Main_Left-List";
	var Class = new ListCommon();
	Class.ChangeDivCss(that, LeftDivId);
	Class = new Path();
	Class.LoadPathHtml($(that).text(), 1, "main_PathTcpModule_click(this)");
	Class = new LoadHtml();
	var Html = Class.GetVariableTranslationHtml(Global_TcpModuleCss);
	Html = Html + Class.GetVariableTranslationHtml(Global_TcpModuleFirstPageHtml);
	Html = Html + Class.GetVariableTranslationHtml(Global_TcpModuleSecondPageHtml);
	$("#Main_Center-Content").empty();
	$("#Main_Center-Content").append(Html);
	Class = new TcpModuleFirstPage();
	Class.Initialization();
	Class = null;
}
//-----------Center-----------
//__________TCP模組__________
  //第一頁
function main_TcpModuleSaveButton_click(that)
{
	var Class = new TcpModuleFirstPage();
	Class.SaveButton(that);
	Class = null;
}
function main_TcpModuleChangeAllCheckbox_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_TcpModuleAddNewRow_click(that)
{
	var Class = new TcpModuleFirstPage();
	Class.ModuleAddNewRow(that);
	Class = null;
}
function main_TcpModuleCopyDialogEnabled_click(that, Event)
{
	var Class = new TcpModuleFirstPage();
	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_TcpModuleClearDialogEnabled_click(Event)
{
	var Class = new TcpModuleFirstPage();
	Class.ClearDialogEnabled(Event);
	Class = null;
}
function main_TcpModuleDeleteModule_click(that)
{
	var Class = new TcpModuleFirstPage();
	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_TcpModuleShowPreviousPage_click()
{
	var Class = new TcpModuleFirstPage();
	Class.ShowPreviousPage();
	Class = null;
}
function main_TcpModuleShowNextPage_click()
{
	var Class = new TcpModuleFirstPage();
	Class.ShowNextPage();
	Class = null;
}
function main_TcpModuleCopyModule_click()
{
	$(".Dialog").find(".Message").show();
	var Class = new TcpModuleFirstPage();
	Class.CopyModule();
	Class = null;
}
function main_TcpModuleCopyDialogDisabled_click()
{
	var Class = new TcpModuleFirstPage();
	Class.CopyDialogDisabled();
	Class = null;
}
function main_TcpModuleClearDialogDisabled_click()
{
	var Class = new TcpModuleFirstPage();
	Class.ClearDialogDisabled();
	Class = null;
}
function main_TcpModuleSettingButton_click(that)
{
	var Class = new TcpModuleFirstPage();
	Class.EditButton(that);
	Class = null;
}
function main_TcpModuleClearAllModule_click(that)
{
	var Class = new TcpModuleFirstPage();
	Class.ClearAllModule(that);
	Class = null;
}

  //第二頁
function main_TcpModuleProduceTable_click(that)
{
	var Class = new TcpModuleSecondPage();
	Class.ProduceTable(that);
	Class = null;
}
function main_TcpModuleShowDataModeTable_click(TableId)
{
	$("#"+TableId).show();
}
function main_TcpModuleHideDataModeTable_click(TableId)
{
	if($("#"+TableId).find(".Message").is(":visible") == true){
		return 0;
	}
	$("#"+TableId).hide();
}
function main_TcpModuleChangeModbusTab_click(Mode, that)
{
	var Class = new TcpModuleSecondPage();
	Class.ChangeModbusTab(Mode, that);
	Class = null;
}
function main_TcpModuleOkButton_click(that)
{
	var Class = new TcpModuleSecondPage();
	Class.OkButton(that);
	Class = null;
}
function main_TcpModuleCancelButton_click(that)
{
	var Class = new TcpModuleSecondPage();
	Class.CancelButton(that);
	Class = null;
}
function main_TcpModuleEditButton_click(that)
{
	var Class = new TcpModuleSecondPage();
	Class.EditButton(that);
	Class = null;
}
function main_TcpModuleDeleteButton_click(that)
{
	var Class = new TcpModuleSecondPage();
	Class.DeleteButton(that);
	Class = null;
}

function main_TcpModuleConfirmButton_click(that)
{
	var Class = new TcpModuleSecondPage();
	Class.ConfirmButton(that);
	Class = null;
}

function main_TcpModuleNoConfirmButton_click()
{
	var Class = new TcpModuleSecondPage();
	Class.NoConfirmButton();
	Class = null;
}
function main_TcpModuleScaleRangeSettingEnabled_click(that)
{
	$(".ScaleDialog").find(".Message").show();
	var Class = new TcpModuleSecondPage();
	Class.ScaleRangeSettingEnabled(that);
	Class = null;
}
function main_TcpModuleScaleRangeSettingDisabled_click(that)
{
	//$(".ScaleDialog").find(".Message").show();
	var Class = new TcpModuleSecondPage();
	Class.ScaleRangeSettingDisabled(that);
	Class = null;
}
function main_TcpModuleBitwiseSettingEnabled_click(that)
{
	$(".ScaleDialog").find(".Message").show();
	var Class = new TcpModuleSecondPage();
	Class.BitwiseSettingEnabled(that);
	Class = null;
}
function main_TcpModuleBitwiseSettingDisabled_click(that)
{
	//$(".ScaleDialog").find(".Message").show();
	var Class = new TcpModuleSecondPage();
	Class.BitwiseSettingDisabled(that);
	Class = null;
}