function render_selects() {
    selects = $('form.styled select');
    selects.each(function() {
        option = $('option[selected]', this);
        if (option) {
            option = option[0];
        } else {
            option = $('option', this)[0]
        }
        s = $('<span>'+option.text+'</span>');
        if ($(this).attr('class')) {
            s.addClass('select_p');
        } else {
            s.addClass('select');
        }
        s.insertBefore(this);
        this.onchange = function () {
            option = $('option[selected]', this);
            $(this).prev().text(option.text());
        };
    });
}
$(document).ready(function() {
    render_selects()
});

