$(document).ready(function() {
	// for the browse navs
	$('ul.rightnav-list ul').hide();
	$('#expander li.item_parent a').click(
		function() {
			var checkElement = $(this).next();
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				checkElement.slideUp('normal');
				checkElement.parent().removeClass('browse_selected');
				return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				checkElement.slideDown('normal');
				checkElement.parent().addClass('browse_selected');
				return false;
			}
		}
	);
	
	$("a.showbox").hover(
		function(){
			hoverbox_show(this.id)
		},
		function(){
			$("#ShowBoxPopup").fadeOut("fast");
			$("#ShowBoxPopup").remove()
		}
	);
});

function hoverbox_show (element_id) {
 	var e = $("#"+element_id);
	var x = e.position().left;
	var y = e.position().top;	
	x = x + e.outerWidth() + 15;
	y = y - 100;
	var description = hover_data[element_id];
	
	$("body").append('<div id="ShowBoxPopup" style="left:' + x + 'px;top:' + y + 'px; display:none;"><div id="ShowBoxWrapper"><div id="show_box_content"><img src="/swfs/pages/shows/thumbs/' + element_id + '.jpg" /><p>'+description+'</p></div></div><div id="ShowBoxPointyBit"></div>');
	$("#ShowBoxPopup").fadeIn("fast");
}