//第1頁
MysqlConnectionFirstPage.prototype._AutomaticName_ = function()
{
	var Table = $("#Main_Center-Content").find(".Body").eq(0).find(".Table").eq(0);
	var Index = 1;
	var object = jQuery.parseJSON(JSON.stringify(Global_MysqlConnection));
	var number = Object.keys(object);
	var Name, NameArray=new Array();
	for(var i=0; i<number.length; i++)
	{
		NameArray.push(object[number[i]]["IdentificationName"]);
	}
	while(true)
	{
		Name = "Name"+Index;
		if(NameArray.indexOf(Name) == -1)
		{
			break;
		}
		Index++;
	}
	Table.find(".Row").eq(1).find(".Text").val(Name);
}

MysqlConnectionFirstPage.prototype._BuildMysqlConnectionObject_ = function(that)
{
	var number = Object.keys(Global_MysqlConnection);
	if(number.length == 0)
	{
		number=1;
	}
	else if(number.length>0)
	{
		number = Math.max.apply(null,number)+1;
	}
	if(typeof(Global_MysqlConnection[number]) == "undefined")
	{
		Global_MysqlConnection[number] = new Object();
		Global_MysqlConnection[number]["IdentificationName"] = $(that).closest(".Row").find(".Column").eq(2).find(".Text").val();
		Global_MysqlConnection[number]["DatabaseName"] = "DatabaseName";
		Global_MysqlConnection[number]["TableName"] = "TableName";
		Global_MysqlConnection[number]["IP"] = "127.0.0.1";
		Global_MysqlConnection[number]["Port"] = "3306";
		Global_MysqlConnection[number]["Account"] = "root";
		Global_MysqlConnection[number]["Password"] = "root";
		Global_MysqlConnection[number]["DatabaseMode"] = "Cycle";
		Global_MysqlConnection[number]["Deadband"] = 0;
		Global_MysqlConnection[number]["IntervalSeconds"] = 5;
		Global_MysqlConnection[number]["DateTimeFormat"] = "yyyy-MM-dd,HH:mm:ss";
		Global_MysqlConnection[number]["Enable"] = true;
	}
}

MysqlConnectionFirstPage.prototype._ShowTable_ = function(number, DisplayNumber)
{
	var html = $(".Dynamic").html();  var PageNumber = $("#Toolbar").find(".Text").val();
	Id = "#MysqlConnectionTable";
	$(Id).find(".DynamicRow").remove();
	var Start = (PageNumber-1)*DisplayNumber;
	if((number.length-Start)>DisplayNumber){
		var End = Start + DisplayNumber;
	}
	else{
		var End = number.length;
	}
	var index = 0;  var Variable = Global_MysqlConnection;
	for(var i=Start; i<End && End!=0; i++)
	{
		$(Id).append(html);
		$(Id).find(".DynamicRow").eq(index).find(".Column").eq(0).text(number[i]);
		$(Id).find(".DynamicRow").eq(index).find(".Column").eq(2).text(Variable[number[i]]["IdentificationName"]);
		$(Id).find(".DynamicRow").eq(index).find(".Column").eq(3).find(".Label").hide();
		if(Variable[number[i]]["Enable"] == false){
			$(Id).find(".DynamicRow").eq(index).find(".Column").eq(3).find(".Label").eq(1).show();
		}
		else if(Variable[number[i]]["Enable"] == true){
			$(Id).find(".DynamicRow").eq(index).find(".Column").eq(3).find(".Label").eq(0).show();
		}
		index++;
	}
}

MysqlConnectionFirstPage.prototype._UpdateTableToolbar_ = function(number, DisplayNumber)
{
	var NumberOfPages = Math.ceil(number.length/DisplayNumber);
	var Id = "#Toolbar";
	$(Id).find("label").eq(1).text(NumberOfPages);
	var CurrentlyPage = $(Id).find(".Text").val();
	CurrentlyPage = parseInt(CurrentlyPage);
	if(CurrentlyPage>NumberOfPages)
	{
		$(Id).find(".Text").val(NumberOfPages);
	}
	else if(CurrentlyPage<=0 || isNaN(CurrentlyPage)==true)
	{
		$(Id).find(".Text").val(1);
	}
	else
	{
		$(Id).find(".Text").val(CurrentlyPage);
	}
}

MysqlConnectionFirstPage.prototype._RedisplayUi_ = function()
{
	var DisplayNumber = 10;
	var number = Object.keys(Global_MysqlConnection);
	MysqlConnectionFirstPage.prototype._UpdateTableToolbar_(number, DisplayNumber);
	MysqlConnectionFirstPage.prototype._ShowTable_(number, DisplayNumber);
	var Id = "#MysqlConnectionTable";
	$(Id).find(".Row").eq(0).find(":checkbox").prop("checked",false);
}

MysqlConnectionFirstPage.prototype._AddNewRow_ = function(that)
{
	MysqlConnectionFirstPage.prototype._CheckIdentificationName_();
	var Id = "#MysqlConnectionTable";
	var ShowErrorMessage = $(Id).find(".Row").eq(0).find(".Message").is(":visible");
	if(ShowErrorMessage == true)	{return 0;}
	MysqlConnectionFirstPage.prototype._BuildMysqlConnectionObject_(that);
	MysqlConnectionFirstPage.prototype._RedisplayUi_();
	MysqlConnectionFirstPage.prototype._AutomaticName_();
}

MysqlConnectionFirstPage.prototype._ShowPreviousPage_ = function()
{
	var Id = "#Toolbar";
	var CurrentlyPage = $(Id).find(".Text").val();
	$(Id).find(".Text").val(parseInt(CurrentlyPage)-1);
	MysqlConnectionFirstPage.prototype._RedisplayUi_();
}

MysqlConnectionFirstPage.prototype._ShowNextPage_ = function()
{
	var Id = "#Toolbar";
	var CurrentlyPage = $(Id).find(".Text").val();
	$(Id).find(".Text").val(parseInt(CurrentlyPage)+1);
	MysqlConnectionFirstPage.prototype._RedisplayUi_();
}

MysqlConnectionFirstPage.prototype._RemoveRtuToMysqlConnection_ = function(number)
{
	var Variable = Global_RtuToMysqlConnectionVariable;
	var ModuleIndex=Object.keys(Variable);
	for(var i=0; i<ModuleIndex.length; i++)
	{
		var SystemVariable = Object.keys(Variable[ModuleIndex[i]]);
		for(var j=0; j<SystemVariable.length; j++)
		{
			if(number = Variable[ModuleIndex[i]][SystemVariable[j]]["DatabaseIndex"])
			{
				Variable[ModuleIndex[i]][SystemVariable[j]]["DatabaseIndex"] = "";
			}
		}
	}
}

MysqlConnectionFirstPage.prototype._RemoveTcpToMysqlConnection_ = function(number)
{
	var Variable = Global_TcpToMysqlConnectionVariable;
	var ModuleIndex=Object.keys(Variable);
	for(var i=0; i<ModuleIndex.length; i++)
	{
		var SystemVariable = Object.keys(Variable[ModuleIndex[i]]);
		for(var j=0; j<SystemVariable.length; j++)
		{
			if(number = Variable[ModuleIndex[i]][SystemVariable[j]]["DatabaseIndex"])
			{
				Variable[ModuleIndex[i]][SystemVariable[j]]["DatabaseIndex"] = "";
			}
		}
	}
}

MysqlConnectionFirstPage.prototype._RemoveMqttToMysqlConnection_ = function(number)
{
	var Variable = Global_MqttToMysqlVariable;
	var ModuleIndex=Object.keys(Variable);
	for(var i=0; i<ModuleIndex.length; i++)
	{
		var SystemVariable = Object.keys(Variable[ModuleIndex[i]]);
		for(var j=0; j<SystemVariable.length; j++)
		{
			if(number = Variable[ModuleIndex[i]][SystemVariable[j]]["DatabaseIndex"])
			{
				Variable[ModuleIndex[i]][SystemVariable[j]]["DatabaseIndex"] = "";
			}
		}
	}
}

MysqlConnectionFirstPage.prototype._RemoveGlobalVariable_ = function(number)
{
	Global_MysqlConnection[number] = null;	delete Global_MysqlConnection[number];
	MysqlConnectionFirstPage.prototype._RemoveRtuToMysqlConnection_(number);
	MysqlConnectionFirstPage.prototype._RemoveTcpToMysqlConnection_(number);
	MysqlConnectionFirstPage.prototype._RemoveMqttToMysqlConnection_(number);
}

MysqlConnectionFirstPage.prototype._RemoveTickedMysqlConnection_ = function()
{
	var Id = "#MysqlConnectionTable";
	var element = $(Id).find(".DynamicRow").find(":checked");
	var CheckedLength = element.length;
	for(var i=0; i<CheckedLength; i++)
	{
		var number = element.eq(i).closest(".DynamicRow").find(".Column").eq(0).text();
		MysqlConnectionFirstPage.prototype._RemoveGlobalVariable_(number);
	}
}

MysqlConnectionFirstPage.prototype._DeleteMysqlConnection_ = function()
{
	MysqlConnectionFirstPage.prototype._RemoveTickedMysqlConnection_();
	MysqlConnectionFirstPage.prototype._RedisplayUi_();
}

MysqlConnectionFirstPage.prototype._IsNameRepeat_ = function(Name)
{
	var Return=false;
	var Row = $("#Main_Center-Content").find(".Body").eq(1).find(".Form").eq(0).find(".Row");
	var CurrentlyNumber = Row.eq(0).find(".Text").val();
	var number = Object.keys(Global_MysqlConnection);
	for(var i=0; i<number.length; i++)
	{
		if(Name == Global_MysqlConnection[number[i]]["IdentificationName"])
		{
			Return=true;
			break;
		}
	}
	return Return;
}

MysqlConnectionFirstPage.prototype._IsTickedMysqlConnection_ = function()
{
	var Return=false;
	var Id = "#MysqlConnectionTable";
	if($(Id).find(".DynamicRow").find(":checked").length >0)
	{
		Return=true;
	}
	return Return;
}

MysqlConnectionFirstPage.prototype._Initialization_ = function()
{
	MysqlConnectionFirstPage.prototype._RedisplayUi_();
}

MysqlConnectionFirstPage.prototype._CheckIdentificationName_ = function()
{
	var Id = "#MysqlConnectionTable";
	$(Id).find(".Message").hide();
	var Row=$(Id).find(".Row");
	var Name = Row.eq(1).find(".Text").val();
	if(Name == "")
	{
		Row.eq(0).find(".Message").eq(0).show();
	}
	if(MysqlConnectionFirstPage.prototype._IsNameRepeat_(Name) == true)
	{
		Row.eq(0).find(".Message").eq(1).show();
	}
}

MysqlConnectionFirstPage.prototype._SaveMysqlConnectionSetting_ = function(Result)
{
	var Result_1={"Input":null};
	var Class = new Transmission();
	Class.TransmissionString("SaveMysqlConnection", JSON.stringify(Global_MysqlConnection), Result_1);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true)
		{
			Result["Input"] = true;
			Class = null; delete Class;
			clearInterval(SetInterval);
		}
	},500);
}

MysqlConnectionFirstPage.prototype._EditButton_ = function(that)
{
	$("#Main_Center-Content").find(".Body").eq(1).find(".Message").hide();
	var number = $(that).closest(".DynamicRow").find(".Column").eq(0).text();
	$("#Main_Center-Content").find(".Body").eq(0).hide();	
	var Name = $("#Main_Center-Content").find(".Body").eq(1).find(".FormTitle").eq(0).text();
	$("#Main_Center-Content").find(".Body").eq(1).show();
	var Class = new Path();
	Class.LoadPathHtml(Name, 2);
	Class = null;
	MysqlConnectionSecondPage.prototype._SetInitialValue_(number);
}

MysqlConnectionFirstPage.prototype._SaveButton_ = function(that)
{
	var Result={"Input":null};
	$(that).closest('.Row').find(".Loading").show();
	$(that).closest('.Row').find(".Message").hide();
	MysqlConnectionFirstPage.prototype._SaveMysqlConnectionSetting_(Result);
	var SetInterval = setInterval(function()
	{
		if(Result["Input"] == true)
		{
			$(that).closest('.Row').find(".Loading").hide();
			$(that).closest('.Row').find(".Message").eq(0).show();
			clearInterval(SetInterval);
		}
	},500);
}




















//第2頁
MysqlConnectionSecondPage.prototype._CheckIdentificationName_ = function(that)
{
	$(that).closest(".Row").find(".Message").hide();
	var Name = $(that).val();
//	var Class = new Type();
	if(Name == "")
	{
		$(that).closest(".Row").find(".Message").eq(0).show();
	}
//	Class = null;
	if(MysqlConnectionSecondPage.prototype._IsNameRepeat_(Name) == true)
	{
		$(that).closest(".Row").find(".Message").eq(1).show();
	}
}

MysqlConnectionSecondPage.prototype._CheckDatabaseName_ = function(that)
{
	$(that).closest(".Row").find(".Message").hide();
	var DatabaseName = $(that).val();
	var Class = new Type();
	if(Class.EnglishDigitalAndBottomline(DatabaseName) == false)
	{
		$(that).closest(".Row").find(".Message").eq(0).show();
	}
	Class = null;
}

MysqlConnectionSecondPage.prototype._CheckTableName_ = function(that)
{
	$(that).closest(".Row").find(".Message").hide();
	var TableName = $(that).val();
	var Class = new Type();
	if(Class.EnglishDigitalAndBottomline(TableName) == false)
	{
		$(that).closest(".Row").find(".Message").eq(0).show();
	}
	Class = null;
}

MysqlConnectionSecondPage.prototype._CheckIP_ = function(that)
{
	$(that).closest(".Row").find(".Message").hide();
	var TableName = $(that).val();
	var Class = new Type();
	if(Class.CheckIp(TableName) == false)
	{
		$(that).closest(".Row").find(".Message").eq(0).show();
	}
	Class = null;
}

MysqlConnectionSecondPage.prototype._CheckPort_ = function(that)
{
	$(that).closest(".Row").find(".Message").hide();
	var TableName = $(that).val();
	var Class = new Type();
	if(Class.CheckPositiveIntegersAndZero(TableName) == false)
	{
		$(that).closest(".Row").find(".Message").eq(0).show();
	}
	Class = null;
}

MysqlConnectionSecondPage.prototype._CheckAccount_ = function(that)
{
	$(that).closest(".Row").find(".Message").hide();
	var Account = $(that).val();
	var Class = new Type();
	if(Class.EnglishDigitalAndBottomline(Account) == false)
	{
		$(that).closest(".Row").find(".Message").eq(0).show();
	}
	Class = null;
}

MysqlConnectionSecondPage.prototype._CheckPassword_ = function(that)
{
	$(that).closest(".Row").find(".Message").hide();
	var Password = $(that).val();
	var Class = new Type();
	if(Class.EnglishDigitalAndBottomline(Password) == false)
	{
		$(that).closest(".Row").find(".Message").eq(0).show();
	}
	Class = null;
}

MysqlConnectionSecondPage.prototype._CheckIntervalSeconds_ = function(that)
{
	$(that).closest(".RightColumn").find(".Message").hide();
	var IntervalSeconds = $(that).val();
	IntervalSeconds = parseInt(IntervalSeconds);
	var Class = new Type();
	if(Class.CheckPositiveIntegers(IntervalSeconds) == false)
	{
		$(that).val(1);
		return;
	}
	if(IntervalSeconds < 5)
	{
		IntervalSeconds = 5;
	}
	$(that).val(IntervalSeconds);
	Class = null;
}

MysqlConnectionSecondPage.prototype._CheckGlobalVariableValueExist_ = function(number)
{
	if(typeof(Global_MysqlConnection[number]["DatabaseMode"]) == "undefined")
	{
		Global_MysqlConnection[number]["DatabaseMode"] = "Cycle";
	}
	if(typeof(Global_MysqlConnection[number]["DateTimeFormat"]) == "undefined")
	{
		Global_MysqlConnection[number]["DateTimeFormat"] = "yyyy-MM-dd,HH:mm:ss";
	}
}

MysqlConnectionSecondPage.prototype._CheckDeadbandValue_ = function(that)
{
	var Class = new Type();
	var Deadband =  $(that).val();
	if( Class.CheckFloat(Deadband) == false )
	{
		$(that).val(0);
		Class = null;
		return 0;
	}
	if( Deadband.indexOf("-") != -1 )
	{
		Deadband = Deadband.replace("-", "");
		$(that).val(Deadband);
		Class = null;
		return 0;
	}
	Class = null;
}

MysqlConnectionSecondPage.prototype._IsNameRepeat_ = function(Name)
{
	var Return=false;
	var Row = $("#Main_Center-Content").find(".Body").eq(1).find(".Form").eq(0).find(".Row");
	var CurrentlyNumber = Row.eq(0).find(".Text").val();
	var number = Object.keys(Global_MysqlConnection);
	for(var i=0; i<number.length; i++)
	{
		if(number[i] == CurrentlyNumber)
		{
			continue;
		}	
		if(Name == Global_MysqlConnection[number[i]]["IdentificationName"])
		{
			Return=true;
			break;
		}
	}
	return Return;
}

MysqlConnectionSecondPage.prototype._ClearForm_ = function()
{
	var Row = $("#Main_Center-Content").find(".Body").eq(1).find(".Form").eq(0).find(".Row");
	Row.eq(0).find(".Text").val("");
	Row.eq(1).find(".Text").val("");
	Row.eq(2).find(".TextArea").val("");
	Row.eq(3).find(".Text").val("");
	$("#Main_Center-Content").find(".Body").eq(1).find(".Form").eq(0).find(".Message").hide();
}

MysqlConnectionSecondPage.prototype._GetSettingFormValue_ = function()
{
	var Row = $("#Main_Center-Content").find(".Body").eq(1).find(".Form").eq(0).find(".Row");
	var number = Row.eq(0).find(".Text").val();
	Global_MysqlConnection[number]["IdentificationName"] = Row.eq(1).find(".RightColumn").find(".Text").val();
	Global_MysqlConnection[number]["DatabaseName"]       = Row.eq(2).find(".RightColumn").find(".Text").val();
	Global_MysqlConnection[number]["TableName"]          = Row.eq(3).find(".RightColumn").find(".Text").val();
	Global_MysqlConnection[number]["IP"]                 = Row.eq(4).find(".RightColumn").find(".Text").val();
	Global_MysqlConnection[number]["Port"]               = Row.eq(5).find(".RightColumn").find(".Text").val();
	Global_MysqlConnection[number]["Account"]            = Row.eq(6).find(".RightColumn").find(".Text").val();
	Global_MysqlConnection[number]["Password"]           = Row.eq(7).find(".RightColumn").find(".Text").val();
	Global_MysqlConnection[number]["DatabaseMode"]       = Row.eq(8).find(".RightColumn").find(".Select").val();
	Global_MysqlConnection[number]["Deadband"]           = parseFloat(Row.eq(9).find(".RightColumn").find(".Text").val());
	Global_MysqlConnection[number]["IntervalSeconds"]    = parseInt(Row.eq(10).find(".RightColumn").find(".Text").val());
	Global_MysqlConnection[number]["DateTimeFormat"]     = Row.eq(11).find(".RightColumn").find(".Select").val();
	Global_MysqlConnection[number]["Enable"]             = Row.eq(12).find(".RightColumn").find(":checkbox").prop("checked");
}

MysqlConnectionSecondPage.prototype._SetFormInitialValue_ = function(number)
{
	var Name=Global_MysqlConnection[number]["IdentificationName"];
	var Row = $("#Main_Center-Content").find(".Body").eq(1).find(".Form").eq(0).find(".Row");
	Row.eq(0).find(".Text").val(number);
	Row.eq(1).find(".Text").val(Name);
	Row.eq(2).find(".Text").val(Global_MysqlConnection[number]["DatabaseName"]);
	Row.eq(3).find(".Text").val(Global_MysqlConnection[number]["TableName"]);
	Row.eq(4).find(".Text").val(Global_MysqlConnection[number]["IP"]);
	Row.eq(5).find(".Text").val(Global_MysqlConnection[number]["Port"]);
	Row.eq(6).find(".Text").val(Global_MysqlConnection[number]["Account"]);
	Row.eq(7).find(".Text").val(Global_MysqlConnection[number]["Password"]);
	Row.eq(8).find(".Select").val(Global_MysqlConnection[number]["DatabaseMode"]);
	Row.eq(9).find(".Text").val(Global_MysqlConnection[number]["Deadband"]);
	Row.eq(10).find(".Text").val(Global_MysqlConnection[number]["IntervalSeconds"]);
	Row.eq(11).find(".Select").val(Global_MysqlConnection[number]["DateTimeFormat"]);
	Row.eq(12).find(":checkbox").prop("checked", Global_MysqlConnection[number]["Enable"]);
}

MysqlConnectionSecondPage.prototype._SetInitialValue_ = function(number)
{
	MysqlConnectionSecondPage.prototype._ClearForm_();
	MysqlConnectionSecondPage.prototype._CheckGlobalVariableValueExist_(number);
	MysqlConnectionSecondPage.prototype._SetFormInitialValue_(number);
	MysqlConnectionSecondPage.prototype._ChangeCss_(number);
}

MysqlConnectionSecondPage.prototype._ConfirmButton_ = function(that)
{
	var Message = $("#Main_Center-Content").find(".Body").eq(1).find(".Form").eq(0).find(".Message");
	var Element = $("#Main_Center-Content").find(".Body").eq(1).find(".Message");
	for(var i=0; i<(Message.length -1); i++)
	{
		if(Element.eq(i).is(":visible") == true && Element.eq(i).css("color") != "rgb(34, 119, 0)"){
			$(that).closest(".Form").find(".Message").eq(1).show();
			return 0;
		}
	}
	var Row = $("#Main_Center-Content").find(".Body").eq(1).find(".Form").eq(0).find(".Row");

	MysqlConnectionSecondPage.prototype._GetSettingFormValue_();

	$("#Main_Center-Content").find(".Body").eq(1).hide();
	$("#Main_Center-Content").find(".Body").eq(0).show();
	MysqlConnectionFirstPage.prototype._RedisplayUi_();
	var Class = new Path();
	Class.LoadPathHtml($("#Left-List-MysqlConnection").text(), 1, "main_PathMysqlConnection_click(this)");
	Class = null;
}

MysqlConnectionSecondPage.prototype._NoConfirmButton_ = function()
{
	$("#Main_Center-Content").find(".Body").eq(1).hide();
	$("#Main_Center-Content").find(".Body").eq(0).show();
	var Class = new Path();
	Class.LoadPathHtml($("#Left-List-MysqlConnection").text(), 1, "main_PathMysqlConnection_click(this)");
	Class = null;
}

MysqlConnectionSecondPage.prototype._TestConnection_ = function(that)
{
	var Form = $(that).closest(".Form");
	var Row = Form.find(".Row");
	var IP       = Row.eq(4).find(".Text").val();
	var Account  = Row.eq(6).find(".Text").val();
	var Password = Row.eq(7).find(".Text").val();
	var Port     = Row.eq(5).find(".Text").val();
	var array = new Array(IP, Account, Password, Port);
	$(that).closest(".RightColumn").find(".Loading").show();
	$(that).closest(".RightColumn").find(".Message").hide();
	var ssocket = io.connect();
	ssocket.emit("MysqlConnectionTest", array);
	ssocket.on("MysqlConnectionTest", function (Return)
	{
		$(that).closest(".RightColumn").find(".Loading").hide();
		if(Return == true)
		{
			$(that).closest(".RightColumn").find(".Message").eq(0).show();
		}
		else
		{
			$(that).closest(".RightColumn").find(".Message").eq(1).show();
		}
		ssocket.emit("SocketClose");
	});
}

MysqlConnectionSecondPage.prototype._SelectRecordMode_ = function(that)
{
	var RecordMode = $(that).val();
	if( RecordMode == "Cycle" )
	{
		MysqlConnectionSecondPage.prototype._HideDeadbandRow_();
		MysqlConnectionSecondPage.prototype._ShowIntervalSecond_();
	}
	else if( RecordMode == "DataChange" )
	{
		MysqlConnectionSecondPage.prototype._ShowDeadbandRow_();
		MysqlConnectionSecondPage.prototype._ShowSamplingIntervalSecond_();
	}
}

MysqlConnectionSecondPage.prototype._HideDeadbandRow_ = function()
{
	var Row = $("#Main_Center-Content").find(".Form").eq(0).find(".Row");
	Row.eq(9).hide();
}

MysqlConnectionSecondPage.prototype._ShowDeadbandRow_ = function()
{
	var Row = $("#Main_Center-Content").find(".Form").eq(0).find(".Row");
	Row.eq(9).show();
}

MysqlConnectionSecondPage.prototype._ShowIntervalSecond_ = function()
{
	var Row = $("#Main_Center-Content").find(".Form").eq(0).find(".Row");
	Row.eq(10).find(".LeftColumn").eq(0).show();
	Row.eq(10).find(".LeftColumn").eq(1).hide();
}

MysqlConnectionSecondPage.prototype._ShowSamplingIntervalSecond_ = function()
{
	var Row = $("#Main_Center-Content").find(".Form").eq(0).find(".Row");
	Row.eq(10).find(".LeftColumn").eq(1).show();
	Row.eq(10).find(".LeftColumn").eq(0).hide();
}

MysqlConnectionSecondPage.prototype._ChangeCss_ = function(number)
{
	if( Global_MysqlConnection[number]["DatabaseMode"] == "Cycle" )
	{
		MysqlConnectionSecondPage.prototype._HideDeadbandRow_();
	}
	else if( Global_MysqlConnection[number]["DatabaseMode"] == "DataChange" )
	{
		MysqlConnectionSecondPage.prototype._ShowDeadbandRow_();
	}
}