// for the YUI paginator
// used on the photo gallery pages

YAHOO.util.Event.onDOMReady(function () {
// Set up the application under the YAHOO.example namespace
var Ex = YAHOO.namespace('example');
Ex.content    = YAHOO.util.Dom.get('scrapbook');
Ex.handlePagination = function (state) {
    // Show the appropriate content for the requested page
    Ex.content.className = 'page' + state.page;
    // Update the Paginator's state, confirming change
    Ex.paginator.setState(state);
};
// Create the Paginator widget and subscribe to its changeRequest event
Ex.paginator = new YAHOO.widget.Paginator({
    rowsPerPage : 1,
    totalRecords : Ex.content.getElementsByTagName('div').length,
    containers : 'paging'
});
Ex.paginator.subscribe('changeRequest', Ex.handlePagination);
// Render the Paginator into the configured container(s)
Ex.paginator.render();
});
