(function() {
	if (getVisiblePage() == "region" && getUserNation() !== "") {
		$.get("https://nationstatesplusplus.net/nationstates/irc.json", function(data) {
			for (var i = 0; i < data.length; i++) {
				var region = data[i];
				if (region["region"] == getVisibleRegion()) {
					$("<div id='region-irc'></div><div class='hzln'></div>").insertBefore($("h2:contains('Today's World Census Report')"));
					$("#region-irc").append("<h2 style='display: inline-block; margin-bottom: 0;'>Regional IRC</h2>");
					$("#region-irc").append("<div style='display: inline; margin-left: 10px;'><a class='irc-link' href='javascript:void(0)'>(Hide)</a></div>");
					
					if (!getSettings().isEnabled("show_irc")) {
						$("a.irc-link").html("(Show)");
					} else {
						$("#region-irc").append("<iframe seamless='seamless' id='irc-frame' style='border:2px solid; width:100%; height:500px;' src='" + generateIRCURL(region) + "'></iframe>");
					}

					var toggleIRC = function() {
						var irc = $("a.irc-link");
						if ($(irc).html() == "(Hide)") {
							$(irc).html("(Show)");
							$("#irc-frame").hide();
							getSettings(true).setValue("show_irc", false);
						} else {
							$(irc).html("(Hide)");
							if ($("#irc-frame").length == 0) {
								$("#region-irc").append("<iframe seamless='seamless' id='irc-frame' style='border:2px solid; width:100%; height:500px;' src='" + $("#region-irc").data("irc") + "'></iframe>");
							}
							$("#irc-frame").show();
							getSettings(true).setValue("show_irc", true);
						}
					}

					function generateIRCURL(region) {
						var settings = getSettings();
						var network = settings.getValue("irc_network_override", region["network"]);
						var nick = settings.getValue("irc_username_override", getUserNation().replaceAll("_", " ").toTitleCase().replaceAll(" ", "_"));
						var ircUrl = "https://kiwiirc.com/client/" + network;
						if (isDarkTheme()) {
							ircUrl += "/?theme=cli&nick=";
						} else {
							ircUrl += "/?theme=relaxed&nick=";
						}
						ircUrl += nick + "&" + region["channel"];
						return ircUrl;
					}

					$("#region-irc").data("irc", generateIRCURL(region));
					$("a.irc-link").on("click", toggleIRC);
					break;
				}
			}
		});
	}
})();


@@ -627,20 +627,20 @@
 id(0)'%3E(
-Hide
+Show
 )%3C/a%3E%3C/d
@@ -650,304 +650,14 @@
 %22);%0A
-%09%09%09%09%09
 %0A%09%09%09%09%09
-if (!getSettings().isEnabled(%22show_irc%22)) %7B%0A%09%09%09%09%09%09$(%22a.irc-link%22).html(%22(Show)%22);%0A%09%09%09%09%09%7D else %7B%0A%09%09%09%09%09%09$(%22#region-irc%22).append(%22%3Ciframe seamless='seamless' id='irc-frame' style='border:2px solid; width:100%25; height:500px;' src='%22 + generateIRCURL(region) + %22'%3E%3C/iframe%3E%22);%0A%09%09%09%09%09%7D%0A%0A%09%09%09%09%09
 var 
@@ -711,16 +711,57 @@
 rc-link%22
+);%0A%09%09%09%09%09%09console.log(%22IRC: %22 + irc.html()
 );%0A%09%09%09%09%09
@@ -768,15 +768,12 @@
 %09if 
-($
 (irc
-)
 .htm
@@ -790,38 +790,35 @@
 ide)%22) %7B%0A%09%09%09%09%09%09%09
-$(
 irc
-)
 .html(%22(Show)%22);
@@ -929,14 +929,11 @@
 %09%09%09%09
-$(
 irc
-)
 .htm
@@ -1942,16 +1942,93 @@
 leIRC);%0A
+%09%0A%09%09%09%09%09if (getSettings().isEnabled(%22show_irc%22)) %7B%0A%09%09%09%09%09%09toggleIRC();%0A%09%09%09%09%09%7D%0A%0A
 %09%09%09%09%09bre

Fix irc frame on Firefox