/* 
 * Flying Dique Circus
 * fix_infobox.js
 * Client-side panel infobox initialization: size the initial infobox and bind enent handlers to the other infoboxes when they are selected
 */ 

// If jQuery doesn't exist, not my problem
$ = jQuery;
$(function () {
	init_infobox = $("div.ui-tabs-panel:not(.ui-tabs-hide) > div.info");
	if (init_infobox.length > 0) {
		init_infobox.css("top", 
			init_infobox.parent().height() - (init_infobox.outerHeight(true)) + "px");
	}
	
	$("#featured > ul").bind("tabsselect", function(_, _, ui) { 
		infobox = $(ui.panel).children(".info");
		infobox.css("top", "360px");
	});
	$("#featured > ul").bind("tabsshow", function(_, _, ui) { // Documentation lies; third parameter is ui; http://bugs.jqueryui.com/ticket/3063
		infobox = $(ui.panel).children(".info");
		infobox.animate(
			{ top: infobox.parent().height() - (infobox.outerHeight(true)) + "px"} );
	});
});
