Path.prototype._ClearThePathInOrderOfRankings_ = function(RankOrder, DivId)
{
	if(RankOrder == 0)
	{
		$(DivId).empty();
	}
	else
	{
		var DivLength = $(DivId).children("div").length;
		var div = $(DivId).children("div");
		var Start = 2*RankOrder;RankOrder;
		for(var i=Start; i<DivLength; i++)
		{
			div.eq(i).remove();
		}
	}
};

Path.prototype._ReadHtml_ = function(RankOrder, Input)
{
	var Return = ""; var Class = new LoadHtml();
	if(typeof(Input) != "undefined")
	{
		Return = {Input:null};
		if(RankOrder == 0)  {Class.ReadHtml("./Plugin/Main/html/Path/HeadPath.html", Return);}
		else                {Class.ReadHtml("./Plugin/Main/html/Path/OtherPath.html", Return);}
		var SetInterval = setInterval(function(){
		if(Return["Input"] != null)
		{
			Input["Input"] = Return["Input"];
			clearInterval(SetInterval);
		}
		},500);
	}
	else
	{
		if(RankOrder == 0)  {Return = Global_HeadPathHtml;}
		else                {Return = Global_OtherPathHtml;}
	}
	return Return;
};

Path.prototype._TranslateHtml_ = function(Text, Html)
{
	 Html = Html.replace("[$^?^$]", Text);
	 return Html;
};

Path.prototype._ReplaceFunction_ = function(Html, onclick)
{
	 onclick = "onclick=\'"+onclick+"\'";
	 Html = Html.replace('onclick=""'    , onclick);
	 Html = Html.replace('onmouseout=""' , 'onmouseout="main_Path_mouseout(this)"');
	 Html = Html.replace('onmouseover=""', 'onmouseover="main_Path_mouseover(this)"');
	 return Html;
};


Path.prototype._ClearTheDivOfTheTail_ = function(that, DivId)
{
	var DivLength = $(DivId).children("div").length;
	var div = $(DivId).children("div");
	var Index = $(that).index();
	Index = Index + 1;
	for(var i=Index; i<DivLength; i++)
	{
		div.eq(i).remove();
	}
	var Class = new LoadHtml();
	var html = Class.ReadHtml("./Plugin/Main/html/Path/Arrow.html");
	Class = null;
	$(DivId).append(html);
};

Path.prototype._LoadPathHtml_ = function(Text, RankOrder, onclick, Async)
{
	var DivLength = $("#Main_Top-Path").children("div").length;  var Html, Input = {Input:null};
	if(((2*RankOrder + 1) <= DivLength) || ((2*RankOrder + 3) <= DivLength) || (RankOrder == 0 &&DivLength == 0))// 2n+1, 2n+3, RankOrder=0 & DivLength=0
	{
		if(Async == true)
		{
			Path.prototype._ReadHtml_(RankOrder, Input);
			var SetInterval2 = setInterval(function(){
			if(Input["Input"] != null && $("#Main_Left-List").find("div").length > 0)
			{
				Html = Path.prototype._TranslateHtml_(Text, Input["Input"]);
				Html = Path.prototype._ReplaceFunction_(Html, onclick);
				Path.prototype._ClearThePathInOrderOfRankings_(RankOrder, "#Main_Top-Path");
				$("#Main_Top-Path").append(Html);
				clearInterval(SetInterval2);
			}
			},500);
		}
		else{
			Html = Path.prototype._ReadHtml_(RankOrder);
			Html = Path.prototype._TranslateHtml_(Text, Html);
			Html = Path.prototype._ReplaceFunction_(Html, onclick);
			Path.prototype._ClearThePathInOrderOfRankings_(RankOrder, "#Main_Top-Path");
			$("#Main_Top-Path").append(Html);
		}
	}
};

Path.prototype._LoadLeftHtml_ = function(DivId, HtmlPath)
{
	$(DivId).empty();
	var Class = new LoadHtml();
	var Html = Class.ReadTranslateAfterOfHtml(HtmlPath);
	$(DivId).append(Html);
	Class = null;
};