﻿/*
* ------------------------------------------------------------------------------------------------
* @author 	Leandro Mancini leandro@neotix.com
* ------------------------------------------------------------------------------------------------
*/

var structure = {
    init: function () {
        trace('structure : init');

        structure.header.init();
        structure.footer.init();

        $.each($('.general .header .slc').find(':selected'), function (i, item) {
            var _text = $(item).text();

            $(item).parent().prev().text(_text)
        });
    },

    header: {
        init: function () {
            structure.header.mount();
        },

        mount: function () {
            $('.general .header .search ul li').last().css({ 'padding': '0' });
            $('.general .header ul.menu li').last().css({ 'background': 'none' });

            $('.general .header .slc').bind('change', function () {
                $(this).prev().text($(this).find(':selected').text());
            }).css({ opacity: '0' });

            $('.general .header .slc:disabled').prev().css({ opacity: '0.5' });
        }
    },

    footer: {
        init: function () {
            structure.footer.mount();
        },

        mount: function () {
            $('.general .footer ul.menu li a')
                .prepend($('<span/>').addClass('l'))
                .append($('<span/>').addClass('r'))
        }
    }
};

$(document).ready(structure.init);
