IoStatusLeftPage.prototype._Initialization_ = function()
{
	var SetInterval = setInterval(function(){ 
	if($("#Main_Left-List").find("div").length > 0 && $("#Main_Center-Content").find("div").length > 0)
	{
		IoStatusLeftPage.prototype._RedisplayRtuModuleMasterUi_();
		IoStatusLeftPage.prototype._RedisplayTcpModuleMasterUi_();
		IoStatusLeftPage.prototype._RedisplayAsciiModuleMasterUi_();
		IoStatusLeftPage.prototype._RedisplayMqttModuleMasterUi_();
		IoStatusLeftPage.prototype._RedisplayEipModuleMasterUi_();
		IoStatusLeftPage.prototype._RedisplayRegisterModuleMasterUi_();
		clearInterval(SetInterval);
	}
	},500);
};
//RTU模組Master
IoStatusLeftPage.prototype._RedisplayRtuModuleMasterUi_ = function()
{
	var ModuleObject=Global_RtuModule;
	var TableId="#RtuModuleMaster";
	var MaxLength=5;
	IoStatusLeftPage.prototype._SetTotalPageNumber_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._CheckPageNumber_(TableId);
	IoStatusLeftPage.prototype._AddDynamicRowHtml_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._SetDynamicRowValue_(ModuleObject, TableId, MaxLength);
};

IoStatusLeftPage.prototype._ShowRtuModuleMasterPreviousPage_ = function()
{
	var TableId="#RtuModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber--;
	if(PageNumber<1)	{PageNumber=1;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayRtuModuleMasterUi_();
};

IoStatusLeftPage.prototype._ShowRtuModuleMasterNextPage_ = function()
{
	var TableId="#RtuModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber++;
	var MaxPageNumber=parseInt($(TableId+"ToolBar").find("label").eq(1).text());
	if(PageNumber>MaxPageNumber)	{PageNumber=MaxPageNumber;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayRtuModuleMasterUi_();
};
//TCP模組Master
IoStatusLeftPage.prototype._RedisplayTcpModuleMasterUi_ = function()
{
	var ModuleObject=Global_TcpModule;
	var TableId="#TcpModuleMaster";
	var MaxLength=5;
	IoStatusLeftPage.prototype._SetTotalPageNumber_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._CheckPageNumber_(TableId);
	IoStatusLeftPage.prototype._AddDynamicRowHtml_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._SetDynamicRowValue_(ModuleObject, TableId, MaxLength);
};

IoStatusLeftPage.prototype._ShowTcpModuleMasterPreviousPage_ = function()
{
	var TableId="#TcpModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber--;
	if(PageNumber<1)	{PageNumber=1;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayTcpModuleMasterUi_();
};

IoStatusLeftPage.prototype._ShowTcpModuleMasterNextPage_ = function()
{
	var TableId="#TcpModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber++;
	var MaxPageNumber=parseInt($(TableId+"ToolBar").find("label").eq(1).text());
	if(PageNumber>MaxPageNumber)	{PageNumber=MaxPageNumber;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayTcpModuleMasterUi_();
};
//ASCII模組Master
IoStatusLeftPage.prototype._RedisplayAsciiModuleMasterUi_ = function()
{
	var ModuleObject=Global_AsciiModule;
	var TableId="#AsciiModuleMaster";
	var MaxLength=5;
	IoStatusLeftPage.prototype._SetTotalPageNumber_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._CheckPageNumber_(TableId);
	IoStatusLeftPage.prototype._AddDynamicRowHtml_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._SetDynamicRowValue_(ModuleObject, TableId, MaxLength);
};

IoStatusLeftPage.prototype._ShowAsciiModuleMasterPreviousPage_ = function()
{
	var TableId="#AsciiModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber--;
	if(PageNumber<1)	{PageNumber=1;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayAsciiModuleMasterUi_();
};

IoStatusLeftPage.prototype._ShowAsciiModuleMasterNextPage_ = function()
{
	var TableId="#AsciiModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber++;
	var MaxPageNumber=parseInt($(TableId+"ToolBar").find("label").eq(1).text());
	if(PageNumber>MaxPageNumber)	{PageNumber=MaxPageNumber;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayAsciiModuleMasterUi_();
};
//MQTT模組Master
IoStatusLeftPage.prototype._RedisplayMqttModuleMasterUi_ = function()
{
	var ModuleObject=Global_MqttModule;
	var TableId="#MqttModuleMaster";
	var MaxLength=5;
	IoStatusLeftPage.prototype._SetTotalPageNumber_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._CheckPageNumber_(TableId);
	IoStatusLeftPage.prototype._AddDynamicRowHtml_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._SetDynamicRowValue_(ModuleObject, TableId, MaxLength);
};

IoStatusLeftPage.prototype._ShowMqttModuleMasterPreviousPage_ = function()
{
	var TableId="#MqttModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber--;
	if(PageNumber<1)	{PageNumber=1;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayMqttModuleMasterUi_();
};

IoStatusLeftPage.prototype._ShowMqttModuleMasterNextPage_ = function()
{
	var TableId="#MqttModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber++;
	var MaxPageNumber=parseInt($(TableId+"ToolBar").find("label").eq(1).text());
	if(PageNumber>MaxPageNumber)	{PageNumber=MaxPageNumber;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayMqttModuleMasterUi_();
};
//EIP模組Master
IoStatusLeftPage.prototype._RedisplayEipModuleMasterUi_ = function()
{
	var ModuleObject=Global_EipModule;
	var TableId="#EipModuleMaster";
	var MaxLength=5;
	IoStatusLeftPage.prototype._SetTotalPageNumber_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._CheckPageNumber_(TableId);
	IoStatusLeftPage.prototype._AddDynamicRowHtml_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._SetDynamicRowValue_(ModuleObject, TableId, MaxLength);
};
//Register 模組Master
IoStatusLeftPage.prototype._RedisplayRegisterModuleMasterUi_ = function()
{
	var ModuleObject=Global_RegisterModule;
	var TableId="#RegisterModuleMaster";
	var MaxLength=5;
	IoStatusLeftPage.prototype._SetTotalPageNumber_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._CheckPageNumber_(TableId);
	IoStatusLeftPage.prototype._AddDynamicRowHtml_(ModuleObject, TableId, MaxLength);
	IoStatusLeftPage.prototype._SetRegisterDynamicRowValue_(ModuleObject, TableId, MaxLength);
};
IoStatusLeftPage.prototype._SetRegisterDynamicRowValue_ = function(ModuleObject, TableId, MaxLength)
{
	var NumberArray=new Array();
	//var Class=new GetValue();
	//var DeviceName = Class.GetModuleAllDeviceName(ModuleObject);
	var number=Object.keys(ModuleObject);
	NumberArray=NumberArray.concat(number);

	
	var PageNumber=$(TableId+"ToolBar").find(".Text").val();
	var Start=(PageNumber-1)*MaxLength;
	var DynamicRowLength=$(TableId).find(".DynamicRow").length;

	for(var i=0; i<DynamicRowLength; i++)
	{
		//var DeviceName=Class.GetModuleDeviceName(ModuleObject, NumberArray[Start]);
		var GetModuleName = ModuleObject[i + 1]["ModuleName"];
		$(TableId).find(".DynamicRow").eq(i).find(".Column").eq(0).text(NumberArray[Start]);
		$(TableId).find(".DynamicRow").eq(i).find(".Column").eq(1).find(".Text").val(GetModuleName);
		//$(TableId).find(".DynamicRow").eq(i).find(".Column").eq(2).text(DeviceName);
		Start++;
	}
};
IoStatusLeftPage.prototype._ShowEipModuleMasterPreviousPage_ = function()
{
	var TableId="#EipModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber--;
	if(PageNumber<1)	{PageNumber=1;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayEipModuleMasterUi_();
};

IoStatusLeftPage.prototype._ShowEipModuleMasterNextPage_ = function()
{
	var TableId="#EipModuleMaster";
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	PageNumber++;
	var MaxPageNumber=parseInt($(TableId+"ToolBar").find("label").eq(1).text());
	if(PageNumber>MaxPageNumber)	{PageNumber=MaxPageNumber;}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
	IoStatusLeftPage.prototype._RedisplayEipModuleMasterUi_();
};

IoStatusLeftPage.prototype._CheckPageNumber_ = function(TableId)
{
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	var MaxPageNumber=parseInt($(TableId+"ToolBar").find("label").eq(1).text());
	var Class=new Type();
	if(Class.CheckPositiveIntegers(PageNumber) == false ||
	   MaxPageNumber == 0)
	{
		PageNumber=1;
	}
	else if(PageNumber > MaxPageNumber)
	{
		PageNumber = MaxPageNumber;
	}
	$(TableId+"ToolBar").find(".Text").val(PageNumber);
}

IoStatusLeftPage.prototype._AddDynamicRowHtml_ = function(ModuleObject, TableId, MaxLength)
{
	var Length=0;
	$(TableId).find(".DynamicRow").remove();
	var PageNumber=parseInt($(TableId+"ToolBar").find(".Text").val());
	var Class=new GetValue();
	var AllNumber=Class.GetModuleAllNumber(ModuleObject);

	if(AllNumber.length < (PageNumber*MaxLength))
	{
		Length=AllNumber.length-((PageNumber-1)*MaxLength);
	}
	else if(AllNumber.length >= (PageNumber*MaxLength))
	{
		Length=MaxLength;
	}
	var Html=$("#Main_Left-List").find(".Dynamic").html();
	for(var i=0; i<Length; i++)
	{
		$(TableId).append(Html);
	}
};

IoStatusLeftPage.prototype._SetTotalPageNumber_ = function(ModuleObject, TableId, MaxLength)
{
	var Class=new GetValue();
	var AllNumber=Class.GetModuleAllNumber(ModuleObject);
	var Quotient=Math.floor(AllNumber.length/MaxLength);
	var Residue=AllNumber.length%MaxLength;
	var TotalPageNumber;
	if(Residue > 0)
	{
		TotalPageNumber=Quotient+1;
	}
	else
	{
		TotalPageNumber=Quotient;
	}
	$(TableId+"ToolBar").find("label").eq(1).text(TotalPageNumber);
};

IoStatusLeftPage.prototype._SetDynamicRowValue_ = function(ModuleObject, TableId, MaxLength)
{
	var NumberArray=new Array();
	var Class=new GetValue();
	var DeviceName = Class.GetModuleAllDeviceName(ModuleObject);
	for(var i=0; i<DeviceName.length; i++)
	{
		var number=Object.keys(ModuleObject[DeviceName[i]]);
		NumberArray=NumberArray.concat(number);
	}
	
	var PageNumber=$(TableId+"ToolBar").find(".Text").val();
	var Start=(PageNumber-1)*MaxLength;
	var DynamicRowLength=$(TableId).find(".DynamicRow").length;

	for(var i=0; i<DynamicRowLength; i++)
	{
		var DeviceName=Class.GetModuleDeviceName(ModuleObject, NumberArray[Start]);
		var GetModuleName=Class.GetModuleName(ModuleObject, NumberArray[Start]);
		$(TableId).find(".DynamicRow").eq(i).find(".Column").eq(0).text(NumberArray[Start]);
		$(TableId).find(".DynamicRow").eq(i).find(".Column").eq(1).find(".Text").val(GetModuleName);
		$(TableId).find(".DynamicRow").eq(i).find(".Column").eq(2).text(DeviceName);
		Start++;
	}
};

IoStatusLeftPage.prototype._ChangeCurrentDivCss_ = function(that)
{
	var LeftDivId="#Main_Left-List";
	$(LeftDivId).find(".Column").css("border-left-color", "rgb(251, 251, 251)");
	$(LeftDivId).find(".Column").css("color", "rgb(112, 112, 112)");
	
	$(that).find(".Column").eq(0).css("border-left-color", "rgb(57, 93, 139)");
	$(that).find(".Column").eq(0).css("color", "#000000");
};




















IoStatusCenterPage.prototype._Initialization_ = function()
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	var Class=new GetValue();
	var GlobalVariable=Class.GetGlobalVariable(ModuleType);
	GlobalVariable = JSON.parse(JSON.stringify(GlobalVariable));
	var DisplayNumber = $("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(0).find(".Text").val();

	if(ModuleType == "EIP")
	{
		IoStatusCenterPage.prototype._DeleteEIPModuleChannel_(GlobalVariable, ModuleIndex, DisplayNumber);
	}

	IoStatusCenterPage.prototype._SetTotalPageNumber_(GlobalVariable, ModuleIndex, DisplayNumber);
	IoStatusCenterPage.prototype._CheckPageNumber_();
	IoStatusCenterPage.prototype._ShowVariableTable_(GlobalVariable, ModuleIndex, DisplayNumber);
	IoStatusCenterPage.prototype._DBusReadVariantArray_(ModuleType, ModuleIndex, GlobalVariable);
	$("#Main_Center-Content").find(".MappingTable").find(".Tab").eq(1).click();
	IoStatusTab="ShowIoStatus";
};

IoStatusCenterPage.prototype._TcpScalingInitialization_ = function()
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	var GlobalVariable;
	if(IoStatusCenterPage.prototype._CheckGlobalVariableIndexValue_(Global_TcpScalingVariable, ModuleIndex) == false) 
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	GlobalVariable=Global_TcpScalingVariable;
	GlobalVariable = JSON.parse(JSON.stringify(GlobalVariable));
	var ObjectKey = Object.keys(GlobalVariable);
	if(ObjectKey.length <= 0)
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	var DisplayNumber = $("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(0).find(".Text").val();

	GlobalVariable = IoStatusCenterPage.prototype._ScalingVariablePretreatment_(GlobalVariable, ModuleIndex);
	IoStatusCenterPage.prototype._SetTotalPageNumber_(GlobalVariable, ModuleIndex, DisplayNumber);
	IoStatusCenterPage.prototype._CheckPageNumber_();
	IoStatusCenterPage.prototype._ShowScalingVariableTable_(GlobalVariable, ModuleIndex, DisplayNumber);
	IoStatusCenterPage.prototype._DBusReadScalingVariantArray_(ModuleType, ModuleIndex, GlobalVariable);
};

IoStatusCenterPage.prototype._RtuScalingInitialization_ = function()
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	var GlobalVariable;
	if(IoStatusCenterPage.prototype._CheckGlobalVariableIndexValue_(Global_RtuScalingVariable, ModuleIndex) == false) 
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	GlobalVariable = JSON.parse(JSON.stringify(Global_RtuScalingVariable));
	var ObjectKey = Object.keys(GlobalVariable);
	if(ObjectKey.length <= 0)
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	var DisplayNumber = $("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(0).find(".Text").val();

	GlobalVariable = IoStatusCenterPage.prototype._ScalingVariablePretreatment_(GlobalVariable, ModuleIndex);
	IoStatusCenterPage.prototype._SetTotalPageNumber_(GlobalVariable, ModuleIndex, DisplayNumber);
	IoStatusCenterPage.prototype._CheckPageNumber_();
	IoStatusCenterPage.prototype._ShowScalingVariableTable_(GlobalVariable, ModuleIndex, DisplayNumber);
	IoStatusCenterPage.prototype._DBusReadScalingVariantArray_(ModuleType, ModuleIndex, GlobalVariable);
};

IoStatusCenterPage.prototype._ShowScalingVariableTable_ = function(GlobalVariable, ModuleIndex, DisplayNumber)
{
	if(typeof(GlobalVariable) != "object" ||
	   typeof(GlobalVariable[ModuleIndex]) != "object")
	{
		return 0;
	}
	var Class=new Algorithm();
	var SystemVariable=Object.keys(GlobalVariable[ModuleIndex]).sort(Class.StringNumberMixedSort());
	if(SystemVariable.length <= 0) 
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	IoStatusCenterPage.prototype._AddScalingDynamicRowHtml_(SystemVariable, DisplayNumber);
	IoStatusCenterPage.prototype._SetScalingDynamicRowValue_(GlobalVariable, ModuleIndex, SystemVariable, DisplayNumber);
};

IoStatusCenterPage.prototype._ScalingVariablePretreatment_ = function(GlobalVariable, ModuleIndex)
{
	var Return = new Object();
	var Class=new Algorithm();
	var SystemVariable=Object.keys(GlobalVariable[ModuleIndex]);

	Return[ModuleIndex] = new Object();

	for(var i=0; i<SystemVariable.length; i++)
	{
		if(GlobalVariable[ModuleIndex][SystemVariable[i]]["TransformScaling"] == true)
		{
			Return[ModuleIndex][SystemVariable[i]] = GlobalVariable[ModuleIndex][SystemVariable[i]];
		}
	}
	return Return;
};

IoStatusCenterPage.prototype._SetScalingDynamicRowValue_ = function(GlobalVariable, ModuleIndex, SystemVariable, DisplayNumber)
{
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	var PageNumber = parseInt($("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find(".Text").val());
	var Start=IoStatusCenterPage.prototype._GetStartRowNumber_(DisplayNumber);
	var VariableType, VariableName, Description;
	for(var i=0; i<DynamicRow.length; i++)
	{
		VariableName=GlobalVariable[ModuleIndex][SystemVariable[Start]]["ScaleVariableName"];
		Description=GlobalVariable[ModuleIndex][SystemVariable[Start]]["Description"];
		DynamicRow.eq(i).find(".Column").eq(0).text(SystemVariable[Start]);
		DynamicRow.eq(i).find(".Column").eq(1).find(".Text").val(VariableName);
		DynamicRow.eq(i).find(".Column").eq(2).text("Float");
		DynamicRow.eq(i).find(".Column").eq(4).find(".Text").val(Description);
		Start++;
	}
};

IoStatusCenterPage.prototype._TcpBitwiseInitialization_ = function()
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	var GlobalVariable;
	if(IoStatusCenterPage.prototype._CheckGlobalVariableIndexValue_(Global_TcpBitwiseVariable, ModuleIndex) == false) 
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	GlobalVariable=Global_TcpBitwiseVariable;
	GlobalVariable = JSON.parse(JSON.stringify(GlobalVariable));
	var ObjectKey = Object.keys(GlobalVariable);
	if(ObjectKey.length <= 0)
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	var DisplayNumber = $("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(0).find(".Text").val();

	var BitwiseTotalTag=IoStatusCenterPage.prototype._BitwiseVariablePretreatment_(GlobalVariable, ModuleIndex);
	IoStatusCenterPage.prototype._SetBitwiseTotalPageNumber_(BitwiseTotalTag, DisplayNumber);
	IoStatusCenterPage.prototype._CheckPageNumber_();
	IoStatusCenterPage.prototype._ShowBitwiseVariableTable_(BitwiseTotalTag, GlobalVariable, ModuleIndex, DisplayNumber);
	IoStatusCenterPage.prototype._DBusReadBitwiseVariantArray_(ModuleType, ModuleIndex, BitwiseTotalTag, GlobalVariable);
};

IoStatusCenterPage.prototype._RtuBitwiseInitialization_ = function()
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	var GlobalVariable;
	if(IoStatusCenterPage.prototype._CheckGlobalVariableIndexValue_(Global_RtuBitwiseVariable, ModuleIndex) == false) 
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	GlobalVariable=Global_RtuBitwiseVariable;
	GlobalVariable = JSON.parse(JSON.stringify(GlobalVariable));
	var ObjectKey = Object.keys(GlobalVariable);
	if(ObjectKey.length <= 0)
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
		return;
	}
	var DisplayNumber = $("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(0).find(".Text").val();

	var BitwiseTotalTag=IoStatusCenterPage.prototype._BitwiseVariablePretreatment_(GlobalVariable, ModuleIndex);
	IoStatusCenterPage.prototype._SetBitwiseTotalPageNumber_(BitwiseTotalTag, DisplayNumber);
	IoStatusCenterPage.prototype._CheckPageNumber_();
	IoStatusCenterPage.prototype._ShowBitwiseVariableTable_(BitwiseTotalTag, GlobalVariable, ModuleIndex, DisplayNumber);
	IoStatusCenterPage.prototype._DBusReadBitwiseVariantArray_(ModuleType, ModuleIndex, BitwiseTotalTag, GlobalVariable);
};

IoStatusCenterPage.prototype._SetBitwiseTotalPageNumber_ = function(BitwiseTotalTag, DisplayNumber)
{
	var Quotient=Math.floor(BitwiseTotalTag.length/DisplayNumber);
	var Residue=BitwiseTotalTag.length%DisplayNumber;
	var TotalPageNumber;
	if(Residue > 0)
	{
		TotalPageNumber=Quotient+1;
	}
	else
	{
		TotalPageNumber=Quotient;
	}
	$("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find("label").eq(1).text(TotalPageNumber);
};

IoStatusCenterPage.prototype._ShowBitwiseVariableTable_ = function(BitwiseTotalTag, GlobalVariable, ModuleIndex, DisplayNumber)
{
	if(typeof(BitwiseTotalTag) != "object" ||
	   typeof(GlobalVariable) != "object" ||
	   typeof(GlobalVariable[ModuleIndex]) != "object")
	{
		return 0;
	}
	IoStatusCenterPage.prototype._AddBitwiseDynamicRowHtml_(BitwiseTotalTag, DisplayNumber);
	IoStatusCenterPage.prototype._SetBitwiseDynamicRowValue_(BitwiseTotalTag, GlobalVariable, ModuleIndex, DisplayNumber);
};

IoStatusCenterPage.prototype._BitwiseVariablePretreatment_ = function(GlobalVariable, ModuleIndex)
{
	var Return=new Array(); var Obj=new Object(); var BitNameId = ""; var VariableName; var BitTotalNumber = 0;
	var Class=new Algorithm();
	var SystemVariable=Object.keys(GlobalVariable[ModuleIndex]).sort(Class.StringNumberMixedSort());
	var ObjKey=Object.keys(SystemVariable);

	for(var i=0; i<ObjKey.length; i++)
	{
		if(GlobalVariable[ModuleIndex][SystemVariable[i]]["DataType"] == "Short" || GlobalVariable[ModuleIndex][SystemVariable[i]]["DataType"]== "Unsigned Short") BitTotalNumber = 16;
		else if(GlobalVariable[ModuleIndex][SystemVariable[i]]["DataType"] == "Long" || GlobalVariable[ModuleIndex][SystemVariable[i]]["DataType"] == "Unsigned Long")  BitTotalNumber = 32;
		for(var j=0; j<BitTotalNumber; j++)
		{
			BitNameId = "BitTagName-" + j.toString();
			VariableName = IoStatusCenterPage.prototype._GetBitwiseGlobalVariableValue_(GlobalVariable[ModuleIndex], SystemVariable[i], BitNameId);
			if(typeof(VariableName) != "undefined")
			{
				Obj = new Object();
				Obj["BitwiseVariableName"]=VariableName;
				Obj["Description"]=GlobalVariable[ModuleIndex][SystemVariable[i]]["Description"];
				Return.push(Obj);
			}
		}
	}
	return Return;
}

IoStatusCenterPage.prototype._GetBitwiseGlobalVariableValue_ = function(GlobalVariable, SystemVariable, VariableName)
{
	var Return; 

	if(typeof(GlobalVariable[SystemVariable][VariableName]) != "undefined")
	{
		Return = GlobalVariable[SystemVariable][VariableName];
	}
		
	return Return;
}

IoStatusCenterPage.prototype._AddBitwiseDynamicRowHtml_ = function(BitwiseTotalTag, DisplayNumber)
{
	var Table=$("#Main_Center-Content").find(".Table").eq(0);
	Table.find(".DynamicRow").remove();
	var DiDynamicHtml=$("#Main_Center-Content").find(".DiDynamic").html();
	var PageNumber = parseInt($("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find(".Text").val());

	var Start=IoStatusCenterPage.prototype._GetStartRowNumber_(DisplayNumber);
	var End=IoStatusCenterPage.prototype._GetEndRowNumber_(BitwiseTotalTag, DisplayNumber);
	if(Start < 0) Start = 0;
	for(var i=Start; i<End; i++)
	{
		Table.append(DiDynamicHtml);
	}
};

IoStatusCenterPage.prototype._SetBitwiseDynamicRowValue_ = function(BitwiseTotalTag, GlobalVariable, ModuleIndex, DisplayNumber)
{
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	var PageNumber = parseInt($("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find(".Text").val());
	var Start=IoStatusCenterPage.prototype._GetStartRowNumber_(DisplayNumber);
	var Class=new Algorithm();
	var SystemVariable=Object.keys(GlobalVariable[ModuleIndex]).sort(Class.StringNumberMixedSort());
	var VariableType, VariableName, Description;
	for(var i=0; i<DynamicRow.length; i++)
	{
		VariableName=BitwiseTotalTag[Start]["BitwiseVariableName"];
		Description=BitwiseTotalTag[Start]["Description"];
		DynamicRow.eq(i).find(".Column").eq(0).text(SystemVariable[Start]);
		DynamicRow.eq(i).find(".Column").eq(1).find(".Text").val(VariableName);
		DynamicRow.eq(i).find(".Column").eq(2).text("Bool");
		DynamicRow.eq(i).find(".Column").eq(4).find(".Text").val(Description);
		Start++;
	}
};

IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_ = function()
{
	var LeftDivId="#Main_Left-List";
	var Column = $(LeftDivId).find(".Table").find(".DynamicRow").find(".Column");
	var Return;
	for(var i=0; i<Column.length; i++)
	{
		if(Column.eq(i).css("border-left-color") == "rgb(57, 93, 139)")
		{
			Return=Column.eq(i).closest(".DynamicRow");
			break;
		}
	}
	return Return;
};

IoStatusCenterPage.prototype._GetModuleType_ = function(DynamicRow)
{
	var Return;
	var TableId=DynamicRow.closest(".Table").attr("id");
	if(TableId == "RtuModuleMaster")         {Return="MRTU";}
	else if(TableId == "TcpModuleMaster")    {Return="MTCP";}
	else if(TableId == "AsciiModuleMaster")  {Return="MASCII";}
	else if(TableId == "MqttModuleMaster")   {Return="MQTT";}
	else if(TableId == "EipModuleMaster")   {Return="EIP";}
	else if(TableId == "RegisterModuleMaster")   {Return="Internal";}
	return Return;
};

IoStatusCenterPage.prototype._GetRuntimeVariableName_ = function(ModuleType, ModuleIndex, GlobalVariable)
{
	var Return=new Array();
	var SystemVariable=new Array();
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	for(var i=0; i<DynamicRow.length; i++)
	{
		SystemVariable.push(DynamicRow.eq(i).find(".Column").eq(0).text());
	}
	Class=new GetValue();
	for(var i=0; i<SystemVariable.length; i++)
	{
		var RuntimeVariableName=Class.GetRuntimeVariableName(ModuleType, ModuleIndex, SystemVariable[i]);
		Return.push(RuntimeVariableName);
	}
	return Return;
}

IoStatusCenterPage.prototype._GetRuntimeScalingVariableName_ = function(ModuleType, ModuleIndex, GlobalVariable)
{
	var Return=new Array();
	var SystemVariable=new Array();
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	for(var i=0; i<DynamicRow.length; i++)
	{
		SystemVariable.push(DynamicRow.eq(i).find(".Column").eq(0).text());
	}
	Class=new GetValue();
	for(var i=0; i<SystemVariable.length; i++)
	{
		var RuntimeVariableName=Class.GetRuntimeScalingVariableName(ModuleType, ModuleIndex, SystemVariable[i]);
		Return.push(RuntimeVariableName);
	}
	return Return;
}

IoStatusCenterPage.prototype._GetRuntimeBitwiseVariableName_ = function(ModuleType, ModuleIndex, BitwiseTotalTag, GlobalVariable)
{
	var Return=new Array();
	var BitwiseTag=new Array();
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	for(var i=0; i<DynamicRow.length; i++)
	{
		BitwiseTag.push(DynamicRow.eq(i).find(".Column").eq(1).find(":text").val());
	}
	var Class=new Algorithm();
	var SystemVariable=Object.keys(GlobalVariable[ModuleIndex]).sort(Class.StringNumberMixedSort());
	Class=new GetValue();
	for(var i=0; i<SystemVariable.length; i++)
	{
		for(var j=0; j<BitwiseTag.length; j++)
		{
			var RuntimeVariableName=Class.GetRuntimeBitwiseVariableName(BitwiseTag[j], ModuleType, ModuleIndex, SystemVariable[i]);
			if( (RuntimeVariableName != null) && (RuntimeVariableName != '') )
			{
				Return.push(RuntimeVariableName);
			}
		}
	}
	return Return;
}

IoStatusCenterPage.prototype._ShowVariableTable_ = function(GlobalVariable, ModuleIndex, DisplayNumber)
{
	if(typeof(GlobalVariable) != "object" ||
	   typeof(GlobalVariable[ModuleIndex]) != "object")
	{
		return 0;
	}
	var Class=new Algorithm();
	var SystemVariable=Object.keys(GlobalVariable[ModuleIndex]).sort(Class.StringNumberMixedSort());
	IoStatusCenterPage.prototype._AddDynamicRowHtml_(SystemVariable, DisplayNumber);
	IoStatusCenterPage.prototype._SetDynamicRowValue_(GlobalVariable, ModuleIndex, SystemVariable, DisplayNumber);
};

IoStatusCenterPage.prototype._AddDynamicRowHtml_ = function(SystemVariable, DisplayNumber)
{
	var Table=$("#Main_Center-Content").find(".Table").eq(0);
	Table.find(".DynamicRow").remove();
	var DoDynamicHtml=$("#Main_Center-Content").find(".DoDynamic").html();
	var DiDynamicHtml=$("#Main_Center-Content").find(".DiDynamic").html();
	var AoDynamicHtml=$("#Main_Center-Content").find(".AoDynamic").html();
	var AiDynamicHtml=$("#Main_Center-Content").find(".AiDynamic").html();
	var PageNumber = parseInt($("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find(".Text").val());

	var Start=IoStatusCenterPage.prototype._GetStartRowNumber_(DisplayNumber);
	var End=IoStatusCenterPage.prototype._GetEndRowNumber_(SystemVariable, DisplayNumber);
	for(var i=Start; i<End; i++)
	{
		var VariableType=SystemVariable[i].split("-")[0];
		if(VariableType == "DO")       {Table.append(DoDynamicHtml);}
		else if(VariableType == "DI")  {Table.append(DiDynamicHtml);}
		else if(VariableType == "AO")  {Table.append(AoDynamicHtml);}
		else if(VariableType == "AI")  {Table.append(AiDynamicHtml);}
	}
};

IoStatusCenterPage.prototype._AddScalingDynamicRowHtml_ = function(SystemVariable, DisplayNumber)
{
	var Table=$("#Main_Center-Content").find(".Table").eq(0);
	Table.find(".DynamicRow").remove();
	var DoDynamicHtml=$("#Main_Center-Content").find(".DoDynamic").html();
	var DiDynamicHtml=$("#Main_Center-Content").find(".DiDynamic").html();
	var AoDynamicHtml=$("#Main_Center-Content").find(".ScalingAoDynamic").html();
	var AiDynamicHtml=$("#Main_Center-Content").find(".ScalingAiDynamic").html();
	var PageNumber = parseInt($("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find(".Text").val());

	var Start=IoStatusCenterPage.prototype._GetStartRowNumber_(DisplayNumber);
	var End=IoStatusCenterPage.prototype._GetEndRowNumber_(SystemVariable, DisplayNumber);
	for(var i=Start; i<End; i++)
	{
		var VariableType=SystemVariable[i].split("-")[0];
		if(VariableType == "DO")       {Table.append(DoDynamicHtml);}
		else if(VariableType == "DI")  {Table.append(DiDynamicHtml);}
		else if(VariableType == "AO")  {Table.append(AoDynamicHtml);}
		else if(VariableType == "AI")  {Table.append(AiDynamicHtml);}
	}
};

IoStatusCenterPage.prototype._SetDynamicRowValue_ = function(GlobalVariable, ModuleIndex, SystemVariable, DisplayNumber)
{
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	var PageNumber = parseInt($("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find(".Text").val());
	var Start=IoStatusCenterPage.prototype._GetStartRowNumber_(DisplayNumber);
	var VariableType, VariableName, Description;
	for(var i=0; i<DynamicRow.length; i++)
	{
		VariableName=GlobalVariable[ModuleIndex][SystemVariable[Start]]["VariableName"];
		Description=GlobalVariable[ModuleIndex][SystemVariable[Start]]["Description"];
		DynamicRow.eq(i).find(".Column").eq(0).text(SystemVariable[Start]);
		DynamicRow.eq(i).find(".Column").eq(1).find(".Text").val(VariableName);
		DynamicRow.eq(i).find(".Column").eq(2).text(SystemVariable[Start].split("-")[1]);
		DynamicRow.eq(i).find(".Column").eq(4).find(".Text").val(Description);
		Start++;
	}
};

IoStatusCenterPage.prototype._GetStartRowNumber_ = function(DisplayNumber)
{
	var PageNumber = parseInt($("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find(".Text").val());
	var Return=(PageNumber-1)*DisplayNumber;
	return Return;
};

IoStatusCenterPage.prototype._GetEndRowNumber_ = function(SystemVariable, DisplayNumber)
{
	var PageNumber = parseInt($("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find(".Text").val());
	var Return;
	if(SystemVariable.length < (PageNumber*DisplayNumber))
	{
		Return=SystemVariable.length;
	}
	else if(SystemVariable.length >= (PageNumber*DisplayNumber))
	{
		Return=(PageNumber*DisplayNumber);
	}
	return Return;
};

IoStatusCenterPage.prototype._SetTotalPageNumber_ = function(GlobalVariable, ModuleIndex, DisplayNumber)
{
	var SystemVariable=Object.keys(GlobalVariable[ModuleIndex]);
	var Quotient=Math.floor(SystemVariable.length/DisplayNumber);
	var Residue=SystemVariable.length%DisplayNumber;
	var TotalPageNumber;
	if(Residue > 0)
	{
		TotalPageNumber=Quotient+1;
	}
	else
	{
		TotalPageNumber=Quotient;
	}
	$("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find("label").eq(1).text(TotalPageNumber);
};

IoStatusCenterPage.prototype._InitializationVariable_ = function()
{
	//Global_Socket.close();
	//Global_Socket=null;
	//Global_Socket=io.connect();
	clearInterval(Global_TimeSetInterval);
}

IoStatusCenterPage.prototype._IsUsedIoStatus_ = function(CurrentlyModuleType)
{
	var Return=true;
	if($("#Top-Menu-IOStatus").css("border-bottom-color") != "rgb(57, 93, 139)")
	{
		IoStatusCenterPage.prototype._InitializationVariable_();
		Return=false;
	}
	return Return;
}

IoStatusCenterPage.prototype._SetDioRowValue_ = function(VariableData, Row)
{
	var VariableBool;
	if(VariableData[0] == "0")  {VariableBool=false;}
	else                        {VariableBool=true;}
	var Quality=IoStatusCenterPage.prototype._QualityNumberToString_(VariableData[1]);
	Row.find(".Column").eq(3).find(".Checkbox").prop("checked", VariableBool);
	Row.find(".Column").eq(5).text(Quality);
};

IoStatusCenterPage.prototype._SetAioRowValue_ = function(VariableData, Row)
{
	var Quality=IoStatusCenterPage.prototype._QualityNumberToString_(VariableData[1]);
	Row.find(".Column").eq(3).find(".Text").val(VariableData[0]);
	Row.find(".Column").eq(5).text(Quality);
};

IoStatusCenterPage.prototype._ShowRegisterDynamicRowValue_ = function(VariableIndexArray, DbusVariableData)
{
	var GlobalVariableType = new Array();;
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	for(var i=0; i<DynamicRow.length; i++)
	{
		GlobalVariableType.push(DynamicRow.eq(i).find(".Column").eq(2).text());
		var Row=DynamicRow.eq(i);
		if(IoStatusCenterPage.prototype._IsElementFocus_(Row) == true)	{continue;}
		
		if(DbusVariableData[4][i] != 1){
			var Status=IoStatusCenterPage.prototype._QualityNumberToString_(4);
			Row.find(".Column").eq(5).text(Status);
			continue;
		}
		var VariableData=new Array();
		VariableData.push(DbusVariableData[0][i]);
		VariableData.push(DbusVariableData[3][i]);		
		if(GlobalVariableType[i]=="Bool")
		{
			IoStatusCenterPage.prototype._SetDioRowValue_(VariableData, Row);
		}
		else
		{
			IoStatusCenterPage.prototype._SetAioRowValue_(VariableData, Row);
		}
	}
};

IoStatusCenterPage.prototype._ShowDynamicRowValue_ = function(VariableIndexArray, DbusVariableData)
{
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	for(var i=0; i<DynamicRow.length; i++)
	{
		var Row=DynamicRow.eq(i);
		if(IoStatusCenterPage.prototype._IsElementFocus_(Row) == true)	{continue;}
		
		if(DbusVariableData[4][i] != 1){
			var Status=IoStatusCenterPage.prototype._QualityNumberToString_(4);
			Row.find(".Column").eq(5).text(Status);
			continue;
		}
		var VariableData=new Array();
		VariableData.push(DbusVariableData[0][i]);
		VariableData.push(DbusVariableData[3][i]);
		var RegisterType = VariableIndexArray[i].split(".")[1];
		RegisterType = RegisterType.substring(RegisterType.length - 2);
		if(RegisterType == "DI" || RegisterType == "DO")
		{
			IoStatusCenterPage.prototype._SetDioRowValue_(VariableData, Row);
		}
		else{
			IoStatusCenterPage.prototype._SetAioRowValue_(VariableData, Row);
		}
	}
};

IoStatusCenterPage.prototype._ShowBitwiseDynamicRowValue_ = function(VariableIndexArray, DbusVariableData)
{
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	for(var i=0; i<DynamicRow.length; i++)
	{
		var Row=DynamicRow.eq(i);
		if(IoStatusCenterPage.prototype._IsElementFocus_(Row) == true)	{continue;}
		
		if(DbusVariableData[4][i] != 1){
			var Status=IoStatusCenterPage.prototype._QualityNumberToString_(4);
			Row.find(".Column").eq(5).text(Status);
			continue;
		}
		var VariableData=new Array();
		VariableData.push(DbusVariableData[0][i]);
		VariableData.push(DbusVariableData[3][i]);		
		IoStatusCenterPage.prototype._SetDioRowValue_(VariableData, Row);
	}
};

IoStatusCenterPage.prototype._UpdateScreen_ = function(RuntimeVariableNameArray, ssocket)
{
	var Class = new Cgi();
	var Input = Class.Dbus("DBusReadVariantArray", RuntimeVariableNameArray, false);
	if(Input != null && Input != "")
	{
		if(RuntimeVariableNameArray[0].split("_")[0] == "Internal")
		{
			IoStatusCenterPage.prototype._ShowRegisterDynamicRowValue_(RuntimeVariableNameArray, Input);
		}
		else
		{
			IoStatusCenterPage.prototype._ShowDynamicRowValue_(RuntimeVariableNameArray, Input);
		}
		
	}
	else
	{
		IoStatusCenterPage.prototype._ClearDynamicRowValue_();
	}
/*
	ssocket.emit('DBusReadVariantArray', RuntimeVariableNameArray);
	ssocket.on('DBusReadVariantArray', function (Return)
	{
		if(Return==null)
		{
			IoStatusCenterPage.prototype._ClearDynamicRowValue_();
			return 0;
		}
		IoStatusCenterPage.prototype._ShowDynamicRowValue_(RuntimeVariableNameArray, Return);
	});
*/
};

IoStatusCenterPage.prototype._UpdateBitwiseScreen_ = function(RuntimeVariableNameArray, ssocket)
{
	var Class = new Cgi();
	var Input = Class.Dbus("DBusReadVariantArray", RuntimeVariableNameArray, false);
	if(Input != null && Input != "")
	{
		IoStatusCenterPage.prototype._ShowBitwiseDynamicRowValue_(RuntimeVariableNameArray, Input);
	}
	else
	{
		IoStatusCenterPage.prototype._ClearBitwiseDynamicRowValue_();
	}
};

IoStatusCenterPage.prototype._ShowPreviousPage_ = function(that)
{
	var PageNumber = parseInt($(that).closest(".Row").find(".Text").val());
	PageNumber--;
	$(that).closest(".Row").find(".Text").val(PageNumber);
	if(IoStatusTab=="ShowIoStatus")
	{
		IoStatusCenterPage.prototype._Initialization_();
	}
	else if(IoStatusTab=="ShowScalingIoStatus")
	{
		IoStatusCenterPage.prototype._ShowScalingIoStatus_();
	}
	else if(IoStatusTab=="ShowBitwiseIoStatus")
	{
		IoStatusCenterPage.prototype._ShowBitwiseIoStatus_();
	}
};

IoStatusCenterPage.prototype._ShowNextPage_ = function(that)
{
	var PageNumber = parseInt($(that).closest(".Row").find(".Text").val());
	PageNumber++;
	$(that).closest(".Row").find(".Text").val(PageNumber);
	if(IoStatusTab=="ShowIoStatus")
	{
		IoStatusCenterPage.prototype._Initialization_();
	}
	else if(IoStatusTab=="ShowScalingIoStatus")
	{
		IoStatusCenterPage.prototype._ShowScalingIoStatus_();
	}
	else if(IoStatusTab=="ShowBitwiseIoStatus")
	{
		IoStatusCenterPage.prototype._ShowBitwiseIoStatus_();
	}
};

IoStatusCenterPage.prototype._CheckPageNumber_ = function()
{
	var Row=$("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0)
	var PageNumber = parseInt(Row.find(".Text").val());
	var TotalPageNumber = parseInt(Row.find("label").eq(1).text());
	var Class=new Type();
	if(Class.CheckPositiveIntegers(PageNumber) == false ||
	   PageNumber < 1)
	{
		PageNumber=1;
	}
	else if(PageNumber > TotalPageNumber)
	{
		PageNumber = TotalPageNumber;
	}
	Row.find(".Text").val(PageNumber);
}

IoStatusCenterPage.prototype._CheckVariableQuantity_ = function(that)
{
	//每秒更新10點
	var Element=$("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(1).find(".Text");
	var PollingSecond=parseInt(Element.val());
	var VariableNumber=parseInt($(that).val());
	var Class=new Type();
	var DefaultValue=parseInt(PollingSecond/100);
	if(Class.CheckPositiveIntegers(VariableNumber) == false)
	{
		VariableNumber=10;
	}
	Element.val(VariableNumber*100);
	$(that).val(VariableNumber);
}

IoStatusCenterPage.prototype._GetEIPSystemVariableKeyName_ = function(VariableType, VariableAttribute, Index)
{
	var Return = '';

	if(VariableType == "Bool" && VariableAttribute == 'ReadWrite')
		Return = Return + 'DO'+ '-' + VariableType + '-' + Index;
	else if(VariableType == "Bool" && VariableAttribute == 'Read')
		Return = Return + 'DI'+ '-' + VariableType + '-' + Index;
	else if(VariableType == "Float" && VariableAttribute == 'ReadWrite')
		Return = Return + 'AO'+ '-' + VariableType + '-' + Index;
	else if(VariableType == "Float" && VariableAttribute == 'Read')
		Return = Return + 'AI' + '-' + VariableType + '-' + Index;
	return Return;
}

IoStatusCenterPage.prototype._DeleteEIPModuleChannel_ = function(GlobalVariable, ModuleIndex)
{
	var VariableType, VariableAttribute, ChannelSwitch, SystemVariableName;
	var Channel = parseInt(Global_EipSetting[ModuleIndex]["ModeType"].split("-")[0]);
	var ChannelTick = Object.keys(GlobalVariable[ModuleIndex]).length;
	var ModuleName = Global_EipSetting[ModuleIndex]["NickName"];
	
	for(var i=Channel; i<ChannelTick ; i++)
	{
		VariableType = Global_EipProductSpecification[ModuleName]["VariableType"][i];
		ChannelSwitch = Global_EipProductSpecification[ModuleName]["VariableName"][i].substring(2,4);
		VariableAttribute = Global_EipProductSpecification[ModuleName]["VariableAttribute"][i];
		SystemVariableName = IoStatusCenterPage.prototype._GetEIPSystemVariableKeyName_(VariableType, VariableAttribute, ChannelSwitch);
		GlobalVariable[ModuleIndex][SystemVariableName] = null;  delete GlobalVariable[ModuleIndex][SystemVariableName];
	}
}

IoStatusCenterPage.prototype._QualityNumberToString_ = function(number)
{
	var Return;
	number=parseInt(number);
	switch(number)
	{
		case 0:
			Return="Uncertain";
		break;
		case 1:
			Return="Good";
		break;		
		case 2:
			Return="Bad";
		break;
		case 3:
			Return="Abort";
		break;
		case 4:
			Return="Not exist";
		break;
	}
	return Return;
}

IoStatusCenterPage.prototype._ClearDynamicRowValue_ = function()
{
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	for(var i=0; i<DynamicRow.length; i++)
	{
		var Row=DynamicRow.eq(i);
		var Status=IoStatusCenterPage.prototype._QualityNumberToString_(3);
		Row.find(".Column").eq(5).text(Status);
	}
}

IoStatusCenterPage.prototype._ClearBitwiseDynamicRowValue_ = function()
{
	var DynamicRow=$("#Main_Center-Content").find(".Table").find(".DynamicRow");
	for(var i=0; i<DynamicRow.length; i++)
	{
		var Row=DynamicRow.eq(i);
		var Status=IoStatusCenterPage.prototype._QualityNumberToString_(3);
		Row.find(".Column").eq(5).text(Status);
	}
}

IoStatusCenterPage.prototype._IsElementFocus_ = function(Row)
{
	var Return=Row.find(".Column").eq(3).find(".Text").is(':focus');
	return Return;
}

IoStatusCenterPage.prototype._DBusReadVariantArray_ = function(ModuleType, ModuleIndex, GlobalVariable)
{
	IoStatusCenterPage.prototype._InitializationVariable_();
	var array=IoStatusCenterPage.prototype._GetRuntimeVariableName_(ModuleType, ModuleIndex, GlobalVariable);
	var Second=parseInt($("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(1).find(".Text").val());

	//Global_Socket = io.connect();
	IoStatusCenterPage.prototype._UpdateScreen_(array, Global_Socket);
	Global_TimeSetInterval = setInterval(function()
	{
		if(IoStatusCenterPage.prototype._IsUsedIoStatus_() == false)
		{
			return 0;
		}
		IoStatusCenterPage.prototype._UpdateScreen_(array, Global_Socket);
	}, Second);
};

IoStatusCenterPage.prototype._DBusDoWriteVariantArray_ = function(that)
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var VariableIndex=$(that).closest(".DynamicRow").find(".Column").eq(0).text();
	var Value=$(that).closest(".DynamicRow").find(".Column").eq(3).find(":checkbox").prop("checked");
	
	if(Value==true)			{Value=1;}
	else if(Value==false)	{Value=0;}
	
	var Class=new GetValue();
	var RuntimeVariableName=Class.GetRuntimeVariableName(ModuleType, ModuleIndex, VariableIndex);

	Class=new Cgi();
	var array=new Array(RuntimeVariableName, Value);
	Class.Dbus("DBusWriteVariantArray", array, true);
/*
	var ssocket = io.connect();
	var array=new Array(RuntimeVariableName, Value);
	ssocket.emit('DBusWriteVariantArray', array);
	ssocket.on('DBusWriteVariantArray', function (Return)
	{
		ssocket.emit("SocketClose");
	});
*/
};

IoStatusCenterPage.prototype._DBusAoWriteVariantArray_ = function(that)
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var VariableIndex=$(that).closest(".DynamicRow").find(".Column").eq(0).text();
	var Value=$(that).closest(".DynamicRow").find(".Column").eq(3).find(".Text").val();
	var Class=new GetValue();
	var RuntimeVariableName=Class.GetRuntimeVariableName(ModuleType, ModuleIndex, VariableIndex);

	Class=new Cgi();
	var array=new Array(RuntimeVariableName, Value);
	Class.Dbus("DBusWriteVariantArray", array, true);

/*
	var ssocket = io.connect();
	var array=new Array(RuntimeVariableName, Value);
	ssocket.emit('DBusWriteVariantArray', array);
	ssocket.on('DBusWriteVariantArray', function (Return)
	{
		ssocket.emit("SocketClose");
	});
*/
};

IoStatusCenterPage.prototype._DBusScalingAoWriteVariantArray_ = function(that)
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var VariableIndex=$(that).closest(".DynamicRow").find(".Column").eq(0).text();
	var Value=$(that).closest(".DynamicRow").find(".Column").eq(3).find(".Text").val();
	var Class=new GetValue();
	var RuntimeVariableName=Class.GetRuntimeScalingVariableName(ModuleType, ModuleIndex, VariableIndex);

	Class=new Cgi();
	var array=new Array(RuntimeVariableName, Value);
	Class.Dbus("DBusWriteVariantArray", array, true);
};

IoStatusCenterPage.prototype._DBusReadScalingVariantArray_ = function(ModuleType, ModuleIndex, GlobalVariable)
{
	IoStatusCenterPage.prototype._InitializationVariable_();
	var array=IoStatusCenterPage.prototype._GetRuntimeScalingVariableName_(ModuleType, ModuleIndex, GlobalVariable);
	var Second=parseInt($("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(1).find(".Text").val());

	IoStatusCenterPage.prototype._UpdateScreen_(array, Global_Socket);
	Global_TimeSetInterval = setInterval(function()
	{
		if(IoStatusCenterPage.prototype._IsUsedIoStatus_() == false)
		{
			return 0;
		}
		IoStatusCenterPage.prototype._UpdateScreen_(array, Global_Socket);
	}, Second);
};

IoStatusCenterPage.prototype._DBusReadBitwiseVariantArray_ = function(ModuleType, ModuleIndex, BitwiseTotalTag, GlobalVariable)
{
	IoStatusCenterPage.prototype._InitializationVariable_();
	var array=IoStatusCenterPage.prototype._GetRuntimeBitwiseVariableName_(ModuleType, ModuleIndex, BitwiseTotalTag, GlobalVariable);
	var Second=parseInt($("#Main_Center-Content").find(".Form").eq(0).find(".Row").eq(1).find(".Text").val());

	IoStatusCenterPage.prototype._UpdateBitwiseScreen_(array, Global_Socket);
	Global_TimeSetInterval = setInterval(function()
	{
		if(IoStatusCenterPage.prototype._IsUsedIoStatus_() == false)
		{
			return 0;
		}
		IoStatusCenterPage.prototype._UpdateBitwiseScreen_(array, Global_Socket);
	}, Second);
};

IoStatusCenterPage.prototype._GetLeftPageUsedModuleMasterName_ = function()
{
	var DynamicRow=IoStatusCenterPage.prototype._GetLeftPageUsedDynamicRow_();
	var ModuleIndex=parseInt(DynamicRow.find(".Column").eq(0).text());
	var ModuleType=IoStatusCenterPage.prototype._GetModuleType_(DynamicRow);
	return ModuleType;
};

IoStatusCenterPage.prototype._ShowScalingIoStatus_ = function()
{
	var ModuleMasterName=IoStatusCenterPage.prototype._GetLeftPageUsedModuleMasterName_();
	if(ModuleMasterName=="MTCP")
	{
		IoStatusCenterPage.prototype._TcpScalingInitialization_();
	}
	else if(ModuleMasterName=="MRTU")
	{
		IoStatusCenterPage.prototype._RtuScalingInitialization_();
	}
	else
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
	}
}

IoStatusCenterPage.prototype._ShowBitwiseIoStatus_ = function()
{
	var ModuleMasterName=IoStatusCenterPage.prototype._GetLeftPageUsedModuleMasterName_();
	if(ModuleMasterName=="MTCP")
	{
		IoStatusCenterPage.prototype._TcpBitwiseInitialization_();
	}
	else if(ModuleMasterName=="MRTU")
	{
		IoStatusCenterPage.prototype._RtuBitwiseInitialization_();
	}
	else
	{
		IoStatusCenterPage.prototype._ClearCurrentCenterPage_();
	}
}

IoStatusCenterPage.prototype._ClearCurrentCenterPage_ = function()
{
	var Table=$("#Main_Center-Content").find(".Table").eq(0);
	Table.find(".DynamicRow").remove();
	$("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find("Text").eq(0).text(0);
	$("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0).find("label").eq(1).text(0);
}

IoStatusCenterPage.prototype._SetInitialPageNumber_ = function()
{
	var Row=$("#Main_Center-Content").find(".Table").eq(1).find(".Row").eq(0)
	var PageNumber = parseInt(Row.find(".Text").val());
	var Class=new Type();
	if(Class.CheckPositiveIntegers(PageNumber) == false ||
	   PageNumber != 1)
	{
		PageNumber=1;
	}
	Row.find(".Text").val(PageNumber);
}

IoStatusCenterPage.prototype._ClearAllCss_ = function(that)
{
	$(that).parent("div").find(".Tab").css("border-right-color", "#FFFFFF");
	$(that).parent("div").find(".Tab").css("border-left-color", "#FFFFFF");
	$(that).parent("div").find(".Tab").css("border-top-color", "#FFFFFF");
	$(that).parent("div").find(".Tab").css("background-color", "#FFFFFF");
};

IoStatusCenterPage.prototype._ChangeCurrentlyTabCss_ = function(that)
{
	$(that).css("border-right-color", "#395d8b");
	$(that).css("border-left-color", "#395d8b");
	$(that).css("border-top-color", "#395d8b");
	$(that).css("background-color", "#E5F1FF");
};

IoStatusCenterPage.prototype._ChangeIoStatusTab_ = function(Mode, that)
{
	IoStatusCenterPage.prototype._ClearAllCss_(that);
	IoStatusCenterPage.prototype._ChangeCurrentlyTabCss_(that);

	IoStatusCenterPage.prototype._SetInitialPageNumber_();

	if(Mode=="ShowScalingIoStatus")
	{
		IoStatusTab = "ShowScalingIoStatus";
		IoStatusCenterPage.prototype._ShowScalingIoStatus_();
	}
	else if(Mode == "ShowBitwiseIoStatus")
	{
		IoStatusTab = "ShowBitwiseIoStatus";
		IoStatusCenterPage.prototype._ShowBitwiseIoStatus_();
	}
	else if(Mode == "ShowIoStatus")
	{
		IoStatusTab = "ShowIoStatus";
		IoStatusCenterPage.prototype._Initialization_();
	}
};

IoStatusCenterPage.prototype._CheckGlobalVariableIndexValue_ = function(GlobalVariable, Index)
{
	var Return = true;
	if(typeof(GlobalVariable[Index]) != "object")
	{
		Return = false;
	}
	return Return;
};