function UpdateAbilities(abilityList) {
	var talents = []
	var ability_count = 0
	var talent_count = 0

	$("#AghanimPreview").style.visibility = "collapse";
	$("#TalentPreview").style.visibility = "visible";
	$("#AghanimPreviewText").text = ""
	$("#AghanimPreviewText_Description").text = ""

	for (var i = 1; i <= 24; i++) {
		var abilityPanel = abilityPanels[i - 1]
		var ability = abilityList[i]
		if (ability != null) {
			if (i <= 8) {
				ability_count = ability_count + 1
				abilityPanel.abilityname = ability;
				abilityPanel.style.visibility = 'visible';

				for (var j = 0; j <= hiddenAbilities.length - 1; j++) {
					var ability_hidden = hiddenAbilities[j]
					if (ability_hidden != null) {
						if (ability == ability_hidden) {
							abilityPanel.style.visibility = 'collapse';
						}
					}
				}

				(function (abilityPanel, ability) {
					abilityPanel.SetPanelEvent("onmouseover", function () {
						$.DispatchEvent("DOTAShowAbilityTooltip", abilityPanel, ability);
					})
					abilityPanel.SetPanelEvent("onmouseout", function () {
						$.DispatchEvent("DOTAHideAbilityTooltip", abilityPanel);
					})
				})(abilityPanel, ability);
			} else if (i == 9) {
				if (ability) {
					$("#AghanimPreview").style.visibility = "visible";
					$("#AghanimPreview").style.visibility = "visible";
					$("#AghanimPreviewText").text = $.Localize("dota_tooltip_ability_" + ability)
					$("#AghanimPreviewText_Description").html = true
					$("#AghanimPreviewText_Description").text = $.Localize("dota_tooltip_ability_" + ability + "_aghanim_Description")
				}
			} else if (i >= 10) {
				if (ability.search("special") != -1) {
					talents[talent_count] = ability
					talent_count = talent_count + 1
				}
			}
		} else {
			if (i < 10) {
				abilityPanel.abilityname = null;
				abilityPanel.style.visibility = 'collapse';
				abilityPanel.onmouseover = null;
			}
		}
	}

	SetupTalentTooltips(talents)

	var abilityParentPanel = $("#AbilitiesPreview");
	abilityParentPanel.SetHasClass("six_abilities", ability_count >= 6);
	abilityParentPanel.SetHasClass("five_abilities", ability_count == 5);
	abilityParentPanel.SetHasClass("four_abilities", ability_count == 4);

	// Credits panel

	if ($("#credits_coder_panel"))
		$("#credits_coder_panel").DeleteAsync(0)

	var coder_steamid = $.Localize("#code_credits_" + abilityList[0])

	if (coder_steamid.search("7") != -1) {

		var coder_panel = $.CreatePanel("Panel", $("#HeroPreviewCredits"), "credits_coder_panel");

		var coder_label = $.CreatePanel('Label', coder_panel, 'credits_coder_label');
		coder_label.text = "Author: "

		// Show coder steam profile
		var steam_id = $.CreatePanel("DOTAAvatarImage", coder_panel, "credits_coder");
		steam_id.steamid = coder_steamid;
		steam_id.style.width = "38px";
		steam_id.style.height = "38px";
		steam_id.style.marginLeft = "20px";
		steam_id.style.marginRight = "20px";
		steam_id.style.align = "left center";
		steam_id.style.border = "2px solid darkred";
	}

	if ($("#credits_editors_panel"))
		$("#credits_editors_panel").DeleteAsync(0)

	var i = 1;
	var editor_steamid = $.Localize("#code_credits_" + abilityList[0] + "_editor_" + i)
	while (editor_steamid.search("7") != -1) {

		if (i == 1) {
			var editor_label = $.CreatePanel('Label', coder_panel, "credits_editor_label");
			editor_label.text = "Contributors: "
		}

		// Show coder steam profile
		var steam_id = $.CreatePanel("DOTAAvatarImage", coder_panel, "credits_editor_" + i);
		steam_id.steamid = editor_steamid;
		steam_id.style.width = "38px";
		steam_id.style.height = "38px";
		steam_id.style.marginLeft = "5px";
		steam_id.style.marginRight = "5px";
		steam_id.style.align = "left center";
		steam_id.style.border = "2px solid gold";

		i++;

		editor_steamid = $.Localize("#code_credits_" + abilityList[0] + "_editor_" + i)
	}
}
/* Updates the selected hero abilities panel */
Updates the selected hero abilities panel
Updates the selected hero abilities panel
function UpdateAbilities(abilityList) {
	var talents = []
	var ability_count = 0
	var talent_count = 0
	$("#AghanimPreview").style.visibility = "collapse";
	$("#TalentPreview").style.visibility = "visible";
	$("#AghanimPreviewText").text = ""
	$("#AghanimPreviewText_Description").text = ""
	for (var i = 1; i <= 24; i++) {
		var abilityPanel = abilityPanels[i - 1]
		var ability = abilityList[i]
		if (ability != null) {
			if (i <= 8) {
				ability_count = ability_count + 1
				abilityPanel.abilityname = ability;
				abilityPanel.style.visibility = 'visible';
				for (var j = 0; j <= hiddenAbilities.length - 1; j++) {
					var ability_hidden = hiddenAbilities[j]
					if (ability_hidden != null) {
						if (ability == ability_hidden) {
							abilityPanel.style.visibility = 'collapse';
						}
					}
				}
				(function (abilityPanel, ability) {
					abilityPanel.SetPanelEvent("onmouseover", function () {
						$.DispatchEvent("DOTAShowAbilityTooltip", abilityPanel, ability);
					})
					abilityPanel.SetPanelEvent("onmouseout", function () {
						$.DispatchEvent("DOTAHideAbilityTooltip", abilityPanel);
					})
				})(abilityPanel, ability);
			} else if (i == 9) {
				if (ability) {
					$("#AghanimPreview").style.visibility = "visible";
					$("#AghanimPreview").style.visibility = "visible";
					$("#AghanimPreviewText").text = $.Localize("dota_tooltip_ability_" + ability)
					$("#AghanimPreviewText_Description").html = true
					$("#AghanimPreviewText_Description").text = $.Localize("dota_tooltip_ability_" + ability + "_aghanim_Description")
				}
			} else if (i >= 10) {
				if (ability.search("special") != -1) {
					talents[talent_count] = ability
					talent_count = talent_count + 1
				}
			}
		} else {
			if (i < 10) {
				abilityPanel.abilityname = null;
				abilityPanel.style.visibility = 'collapse';
				abilityPanel.onmouseover = null;
			}
		}
	}
	SetupTalentTooltips(talents)
	var abilityParentPanel = $("#AbilitiesPreview");
	abilityParentPanel.SetHasClass("six_abilities", ability_count >= 6);
	abilityParentPanel.SetHasClass("five_abilities", ability_count == 5);
	abilityParentPanel.SetHasClass("four_abilities", ability_count == 4);
	if ($("#credits_coder_panel"))
		$("#credits_coder_panel").DeleteAsync(0)
	var coder_steamid = $.Localize("#code_credits_" + abilityList[0])
	if (coder_steamid.search("7") != -1) {
		var coder_panel = $.CreatePanel("Panel", $("#HeroPreviewCredits"), "credits_coder_panel");
		var coder_label = $.CreatePanel('Label', coder_panel, 'credits_coder_label');
		coder_label.text = "Author: "
		var steam_id = $.CreatePanel("DOTAAvatarImage", coder_panel, "credits_coder");
		steam_id.steamid = coder_steamid;
		steam_id.style.width = "38px";
		steam_id.style.height = "38px";
		steam_id.style.marginLeft = "20px";
		steam_id.style.marginRight = "20px";
		steam_id.style.align = "left center";
		steam_id.style.border = "2px solid darkred";
	}
	if ($("#credits_editors_panel"))
		$("#credits_editors_panel").DeleteAsync(0)
	var i = 1;
	var editor_steamid = $.Localize("#code_credits_" + abilityList[0] + "_editor_" + i)
	while (editor_steamid.search("7") != -1) {
		if (i == 1) {
			var editor_label = $.CreatePanel('Label', coder_panel, "credits_editor_label");
			editor_label.text = "Contributors: "
		}
		var steam_id = $.CreatePanel("DOTAAvatarImage", coder_panel, "credits_editor_" + i);
		steam_id.steamid = editor_steamid;
		steam_id.style.width = "38px";
		steam_id.style.height = "38px";
		steam_id.style.marginLeft = "5px";
		steam_id.style.marginRight = "5px";
		steam_id.style.align = "left center";
		steam_id.style.border = "2px solid gold";
		i++;
		editor_steamid = $.Localize("#code_credits_" + abilityList[0] + "_editor_" + i)
	}
}
function UpdateAbilities ( abilityList ) { var talents = [ ] var ability_count = 0 var talent_count = 0 $ ( "#AghanimPreview" ) . style . visibility = "collapse" ; $ ( "#TalentPreview" ) . style . visibility = "visible" ; $ ( "#AghanimPreviewText" ) . text = "" $ ( "#AghanimPreviewText_Description" ) . text = "" for ( var i = 1 ; i <= 24 ; i ++ ) { var abilityPanel = abilityPanels [ i - 1 ] var ability = abilityList [ i ] if ( ability != null ) { if ( i <= 8 ) { ability_count = ability_count + 1 abilityPanel . abilityname = ability ; abilityPanel . style . visibility = 'visible' ; for ( var j = 0 ; j <= hiddenAbilities . length - 1 ; j ++ ) { var ability_hidden = hiddenAbilities [ j ] if ( ability_hidden != null ) { if ( ability == ability_hidden ) { abilityPanel . style . visibility = 'collapse' ; } } } ( function ( abilityPanel , ability ) { abilityPanel . SetPanelEvent ( "onmouseover" , function ( ) { $ . DispatchEvent ( "DOTAShowAbilityTooltip" , abilityPanel , ability ) ; } ) abilityPanel . SetPanelEvent ( "onmouseout" , function ( ) { $ . DispatchEvent ( "DOTAHideAbilityTooltip" , abilityPanel ) ; } ) } ) ( abilityPanel , ability ) ; } else if ( i == 9 ) { if ( ability ) { $ ( "#AghanimPreview" ) . style . visibility = "visible" ; $ ( "#AghanimPreview" ) . style . visibility = "visible" ; $ ( "#AghanimPreviewText" ) . text = $ . Localize ( "dota_tooltip_ability_" + ability ) $ ( "#AghanimPreviewText_Description" ) . html = true $ ( "#AghanimPreviewText_Description" ) . text = $ . Localize ( "dota_tooltip_ability_" + ability + "_aghanim_Description" ) } } else if ( i >= 10 ) { if ( ability . search ( "special" ) != - 1 ) { talents [ talent_count ] = ability talent_count = talent_count + 1 } } } else { if ( i < 10 ) { abilityPanel . abilityname = null ; abilityPanel . style . visibility = 'collapse' ; abilityPanel . onmouseover = null ; } } } SetupTalentTooltips ( talents ) var abilityParentPanel = $ ( "#AbilitiesPreview" ) ; abilityParentPanel . SetHasClass ( "six_abilities" , ability_count >= 6 ) ; abilityParentPanel . SetHasClass ( "five_abilities" , ability_count == 5 ) ; abilityParentPanel . SetHasClass ( "four_abilities" , ability_count == 4 ) ; if ( $ ( "#credits_coder_panel" ) ) $ ( "#credits_coder_panel" ) . DeleteAsync ( 0 ) var coder_steamid = $ . Localize ( "#code_credits_" + abilityList [ 0 ] ) if ( coder_steamid . search ( "7" ) != - 1 ) { var coder_panel = $ . CreatePanel ( "Panel" , $ ( "#HeroPreviewCredits" ) , "credits_coder_panel" ) ; var coder_label = $ . CreatePanel ( 'Label' , coder_panel , 'credits_coder_label' ) ; coder_label . text = "Author: " var steam_id = $ . CreatePanel ( "DOTAAvatarImage" , coder_panel , "credits_coder" ) ; steam_id . steamid = coder_steamid ; steam_id . style . width = "38px" ; steam_id . style . height = "38px" ; steam_id . style . marginLeft = "20px" ; steam_id . style . marginRight = "20px" ; steam_id . style . align = "left center" ; steam_id . style . border = "2px solid darkred" ; } if ( $ ( "#credits_editors_panel" ) ) $ ( "#credits_editors_panel" ) . DeleteAsync ( 0 ) var i = 1 ; var editor_steamid = $ . Localize ( "#code_credits_" + abilityList [ 0 ] + "_editor_" + i ) while ( editor_steamid . search ( "7" ) != - 1 ) { if ( i == 1 ) { var editor_label = $ . CreatePanel ( 'Label' , coder_panel , "credits_editor_label" ) ; editor_label . text = "Contributors: " } var steam_id = $ . CreatePanel ( "DOTAAvatarImage" , coder_panel , "credits_editor_" + i ) ; steam_id . steamid = editor_steamid ; steam_id . style . width = "38px" ; steam_id . style . height = "38px" ; steam_id . style . marginLeft = "5px" ; steam_id . style . marginRight = "5px" ; steam_id . style . align = "left center" ; steam_id . style . border = "2px solid gold" ; i ++ ; editor_steamid = $ . Localize ( "#code_credits_" + abilityList [ 0 ] + "_editor_" + i ) } }
Updates the selected hero abilities panel
Updates the selected hero abilities panel
// Credits panel // Show coder steam profile // Show coder steam profile