
// (c) 2008 mediaunit.de
/**
 * Display a single item out of a list of selections.
 *
 * @author tc
 * @since 2008-05-14
 */
/*
 * Simulate namespaces.
 */
if (typeof es == "undefined") 
    es = new Object();
if (typeof es.fhecor == "undefined") 
    es.fhecor = new Object();

/*
 * Prepare display and selection.
 */
es.fhecor.Selection = {

    initialize: function() {
        this.selection = $('selection');
        if (this.selection) {
            this.hideThumbs();
            this.prepareHeadlines();
            this.hideItems();
        }
    },
    
    select: function(index){
        $('introduction').hide();
        this.hideItems();
        this.selection.select('li')[index].show();
    },
    
    hideThumbs: function(){
        this.selection.select('img.thumb').invoke('hide');
    },
    
    prepareHeadlines: function(){
        this.selection.select('.label').collect(function(label){
            label.update(label.innerHTML.toUpperCase());
        });
    },
    
    hideItems: function(){
        var items = this.selection.select('li');
        items.invoke('hide');
    }
};
