glow.ready(function() {		
	var elements = {
	Component 	: glow.dom.get("div.show_selector").addClass("glow-enabled"), // if glow is available - appens class to div 
	Component2	: glow.dom.get("div#d-recent-shows").addClass("selected"), // corress content to the default tab (see below)
	Component3	: glow.dom.get("ul#show_selector_choice a#a-recent-shows").addClass("selected"), // tabs locationm - sets the default tab
	Tabs		: glow.dom.get("ul#show_selector_choice a")	
	}

	function switchMainPanel(obj) {
		elements.Tabs.each(function () { // grabbing tabs
			if (glow.dom.get(this).attr("id") == "a-" + obj) {
				glow.dom.get(this).addClass("selected");	
			} else {
				glow.dom.get(this).removeClass("selected");
			}
		});
		glow.dom.get("div.show_selector div.box").removeClass("selected");
		glow.dom.get("#d-" + obj).addClass("selected");
	}

	elements.Tabs.each(function () { 
		var myId = glow.dom.get(this).attr('id');
		var ident = myId.substring(2, myId.length); // strips off the first two characters e.g. most-popular
		glow.events.addListener(this, 'click', function () {
			switchMainPanel(ident); // passing the edited param
			return false;	
		});

	});

});