/**
 * Javascript include for all pages
 */

var RecaptchaOptions = {
    theme : 'white'
};

document.observe('dom:loaded', function()
{
    // Preload images used by new 2008 layout
    if (document.images) {
        var images = [
            '/images/main/gb-input-btn-hover.png',
            '/images/gradients/blue_fade.png',
            '/images/main/groups-hover.png',
            '/images/main/communities-hover.png',
            '/images/main/blogs-hover.png',
            '/images/main/articles-hover.png',
            '/images/main/my-realtown-hover.png',
            '/images/main/main-tab-hover.png',
            '/images/main/footer-li-hover.png',
            '/images/icons/information.png',
            '/images/main/word-of-the-day-hover.png',
            '/images/main/ask-the-experts-hover.png',
            '/images/main/question-of-the-day-hover.png',
            '/images/main/word-of-the-day-selected.png',
            '/images/main/ask-the-experts-selected.png',
            '/images/main/question-of-the-day-selected.png'
        ];
        
        var loaded = [];
        
        for (var i = 0, l = images.length; i < l; i++) {
            loaded[i] = new Image();
            loaded[i].src = images[i];
        }
    }
    if ($('message')) {
        $('message').observe('focus', function(e) {
            this.clear();
            this.stopObserving('focus');
        });
    }
    
    
    // Create accordion menu
    /*
    new RT.Accordion($('site-panel'), {
        containerSelector: 'dl.menu',
        handleSelector: 'dt',
        contentSelector: 'dd'
    });
    */
    
    // New Layout Helper
    /*
    if ($('new-layout-feedback')) {
        new RT.Tooltip(
            $('new-layout-feedback'), 
            'Let us know what you think of the New RealTown',
            {
                placement:      {
                    element:        'bottomLeft',
                    tooltip:        'topRight'
                },
                hook:           {
                    element:       $('new-layout-feedback').down('a') 
                },
                offsetTop:      22,
                offsetLeft:     5,
                width:          '200px',
                stem:           'topRight'
            }
        );
    }
    */
});