//-----------Top Path-----------
  //路徑鈕 註冊的function
function main_PathAsciiModule_click(that)
{
	var Class = new Path();
	Class.ClearTheDivOfTheTail(that, "#Main_Top-Path");
	$("#Main_Left-List").css("display", "block");
	Class = new AsciiModuleSecondPage();
	Class.NoConfirmButton();
	Class = null;
}

//-----------Left List-----------
function main_AsciiModule_click(that)
{
	var LeftDivId="#Main_Left-List";
	var Class = new ListCommon();
	Class.ChangeDivCss(that, LeftDivId);
	Class = new Path();
	Class.LoadPathHtml($(that).text(), 1, "main_PathAsciiModule_click(this)");
	Class = new LoadHtml();
	var Html = Class.GetVariableTranslationHtml(Global_AsciiModuleCssHtml);
	Html = Html + Class.GetVariableTranslationHtml(Global_AsciiModuleFirstPageHtml);
	Html = Html + Class.GetVariableTranslationHtml(Global_AsciiModuleSecondPageHtml);
	$("#Main_Center-Content").empty();
	$("#Main_Center-Content").append(Html);
	Class = new AsciiModuleFirstPage();
	Class.Initialization();
	Class = null;
}

//-----------Center-----------
//__________ASCII模組__________
  //第一頁
function main_AsciiModuleSaveButton_click(that)
{
	var Class = new AsciiModuleFirstPage();
	Class.SaveButton(that);
	Class = null;
}
function main_AsciiModuleChangeAllCheckbox_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_AsciiModuleAddNewRow_click(that)
{
	var Class = new AsciiModuleFirstPage();
	Class.ModuleAddNewRow(that);
	Class = null;
}
function main_AsciiModuleCopyDialogEnabled_click(that, Event)
{
	var Class = new AsciiModuleFirstPage();
	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_AsciiModuleClearDialogEnabled_click(Event)
{
	var Class = new AsciiModuleFirstPage();
	Class.ClearDialogEnabled(Event);
	Class = null;
}
function main_AsciiModuleDeleteModule_click(that)
{
	var Class = new AsciiModuleFirstPage();
	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_AsciiModuleShowPreviousPage_click()
{
	var Class = new AsciiModuleFirstPage();
	Class.ShowPreviousPage();
	Class = null;
}
function main_AsciiModuleShowNextPage_click()
{
	var Class = new AsciiModuleFirstPage();
	Class.ShowNextPage();
	Class = null;
}
function main_AsciiModuleCopyModule_click()
{
	$(".Dialog").find(".Message").show();
	var Class = new AsciiModuleFirstPage();
	Class.CopyModule();
	Class = null;
}
function main_AsciiModuleCopyDialogDisabled_click()
{
	var Class = new AsciiModuleFirstPage();
	Class.CopyDialogDisabled();
	Class = null;
}
function main_AsciiModuleClearDialogDisabled_click()
{
	var Class = new AsciiModuleFirstPage();
	Class.ClearDialogDisabled();
	Class = null;
}
function main_AsciiModuleSettingButton_click(that)
{
	var Class = new AsciiModuleFirstPage();
	Class.EditButton(that);
	Class = null;
}
function main_AsciiModuleClearAllModule_click(that)
{
	var Class = new AsciiModuleFirstPage();
	Class.ClearAllModule(that);
	Class = null;
}

  //第二頁
function main_AsciiModuleProduceTable_click(that)
{
	var Class = new AsciiModuleSecondPage();
	Class.ProduceTable(that);
	Class = null;
}
function main_AsciiModuleShowDataModeTable_click(TableId)
{
	$("#"+TableId).show();
}
function main_AsciiModuleHideDataModeTable_click(TableId)
{
	if($("#"+TableId).find(".Message").is(":visible") == true){
		return 0;
	}
	$("#"+TableId).hide();
}
function main_AsciiModuleChangeModbusTab_click(Mode, that)
{
	var Class = new AsciiModuleSecondPage();
	Class.ChangeModbusTab(Mode, that);
	Class = null;
}
function main_AsciiModuleOkButton_click(that)
{
	var Class = new AsciiModuleSecondPage();
	Class.OkButton(that);
	Class = null;
}
function main_AsciiModuleCancelButton_click(that)
{
	var Class = new AsciiModuleSecondPage();
	Class.CancelButton(that);
	Class = null;
}
function main_AsciiModuleEditButton_click(that)
{
	var Class = new AsciiModuleSecondPage();
	Class.EditButton(that);
	Class = null;
}
function main_AsciiModuleDeleteButton_click(that)
{
	var Class = new AsciiModuleSecondPage();
	Class.DeleteButton(that);
	Class = null;
}

function main_AsciiModuleConfirmButton_click(that)
{
	var Class = new AsciiModuleSecondPage();
	Class.ConfirmButton(that);
	Class = null;
}

function main_AsciiModuleNoConfirmButton_click()
{
	var Class = new AsciiModuleSecondPage();
	Class.NoConfirmButton();
	Class = null;
}