﻿$(function()
{
	setTimeout("showKickAppsWidgets()", 1000);
	setTimeout("showMessageBoard()", 1500);
});

//* we want to wait for page to finish loading before loading KickApps widgets
//* they are below the page and should not slow down page load
function showKickAppsWidgets()
{
	var kickAppsWidgets =
		new Array(
			{ divId: "ka-knicks", affiliateSiteId: "32034", widgetId: "13992" },
			{ divId: "ka-rangers", affiliateSiteId: "20434", widgetId: "13995" },
			{ divId: "ka-local", affiliateSiteId: "65142", widgetId: "20655" }
		);

	for (var item in kickAppsWidgets)
	{
		var widget = kickAppsWidgets[item];

		//* if it exists on the page, let's show it. This way we dynamically determine which pages need it
		if ($("#" + widget.divId).length > 0)
		{
			var so = new SWFObject("http://serve.a-widget.com/kickapps/service/getWidgetSwf.kickAction", widget.divId + "-swf", "900", "230", "9", "#FFF");
			so.addParam("wmode", "transparent");
			so.addParam("quality", "high");
			so.addParam("allowNetworking", "all");
			so.addParam("allowScriptAccess", "always");

			so.addVariable("affiliateSiteId", widget.affiliateSiteId);
			so.addVariable("widgetId", widget.widgetId);
			so.addVariable("width", "900");
			so.addVariable("height", "230");
			so.write(widget.divId);
		}
	}
}


google.load("feeds", "1");
function showMessageBoard()
{
	var feedControl = new google.feeds.FeedControl();
	feedControl.setNumEntries(14);
	feedControl.setLinkTarget(google.feeds.LINK_TARGET_BLANK);
	feedControl.addFeed("http://community.msgnetwork.com/eve/forums?a=ci&ci_id=823109262&feedType=rss2", "MSG");
	feedControl.draw(document.getElementById("msg-board-content"));
}
