$(function(){
	if($.browser.msie && $.browser.version.split(".")[0] < 7 && $("#ie6-message").length) {
		if ($.cookie("hide_ie6_message") != "true") {
			$("#ie6-message").css("display", "block");
			$("#ie6-message-close-link").css("display", "block").bind("click", function(){
				$("#ie6-message").remove();
				$.cookie("hide_ie6_message", "true", {path: '/', expires: 0});
				return false;
			});
		}
	}

	window.sportpostApplication = new SportpostApplication();
});

SportpostApplication = function(){
	var app = this;

	app.busy = false;

	app.controls = new SportpostControls(app);
	app.selectors = typeof(window.SportpostSelectorsController) == "function" ? new SportpostSelectorsController(app) : null;
	app.updater = new SportpostUpdater(app);

	app.loginForm = typeof(window.SportpostLoginForm) == "function" ? new SportpostLoginForm(app) : null;
	app.comments = typeof(window.SportpostComments) == "function" ? new SportpostComments(app) : null;
	app.carousel = typeof(window.SportpostCarousel) == "function" ? new SportpostCarousel() : null;
	app.message = typeof(window.SportpostMessage) == "function" ? new SportpostMessage() : null;
	app.buttonController = typeof(window.SportpostButtonController) == "function" ? new SportpostButtonController() : null;
	app.notificationsTracker = typeof(window.SportpostNotificationsTracker) == "function" ? new SportpostNotificationsTracker() : null;
	app.tagsController = typeof(window.SportpostTagsController) == "function" ? new SportpostTagsController() : null;

	$(document).trigger("activateContext", document);

	return app;
}