﻿
var omni = {};

(function() {
	omni = {
		init: function() {
			$("#Grid").click(omni.EventViewSelected);
			$("#List").click(omni.EventViewSelected);
			$("#Calendar").click(omni.EventViewSelected);

			$('#foot #sites li a').click(function() {
				var s = s_gi(getGurrentOmnitureAccount());
				var site = 'Footer-' + $(this).attr('title');
				s.tl(this, "e", site);
			});

			$('#allO2Academies li a').click(function() {
				var s = s_gi(getGurrentOmnitureAccount());
				var site = 'Panel-' + $(this).attr('title');
				s.tl(this, "e", site);
			});

			$('#extraDates .eventViewList tbody a').click(function() {
				var s = s_gi(getGurrentOmnitureAccount());
				var site = 'Event Details-' + $(this).parent().parent().parent().find('.eventViewListVenue a').attr('title');
				s.tl(this, "e", site);
			});

			$('#searchExtraDates .eventViewList tbody a').click(function() {
				var s = s_gi(getGurrentOmnitureAccount());
				var site = 'Search-' + $(this).parent().parent().parent().find('.eventViewListVenueName a').attr('title');
				s.tl(this, "e", site);
			});
		},

		EventViewSelected: function() {
			try {
				var s = s_gi(getGurrentOmnitureAccount());
				var viewType = $(this).attr('id');
				s.tl(this, "o", viewType);
			}
			catch (e) { }
		},

		SiteSelected: function() {
			try {
				var s = s_gi(getGurrentOmnitureAccount());
				var site = 'Panel-' + $(this).attr('title');
				s.tl(this, "e", site);
			}
			catch (e) { }
		},

		FooterSiteSelected: function() {
			try {
				var s = s_gi(getGurrentOmnitureAccount());
				var site = 'Footer-' + $(this).attr('title');
				s.tl(this, "e", site);
			}
			catch (e) { }
		}
	};
})();

