// Returns the number of keys (elements) in an array/dictionary. function obj_length(obj) { if (obj.length !== undefined) { return obj.length; } var count = 0; for (var element in obj) { count++; } return count; } $.fn.makeAbsolute = function(rebase) { return this.each(function() { var el = $(this); var pos = el.position(); el.css({ position: "absolute", marginLeft: 0, marginTop: 0, top: pos.top, left: pos.left, right: $(window).width() - ( pos.left + el.width() ) }); if (rebase) { el.remove().appendTo("body"); } }); }; function ensure_popup_helper() { // And the helper below the popup menus if ( $( "#popup-helper" ).length === 0 ) { $( "