$(document).ready(function() {
    $('.wysiwyg1').rte({
        base_url: '<?php echo $request->base(); ?>',
        width: 800,
        height: 400,
        controls_rte: rte_toolbar,
        controls_html: html_toolbar
    });
    $('.wysiwyg2').rte({
        base_url: '<?php echo $request->base(); ?>',
        width: 600,
        height: 200,
        controls_rte: rte_toolbar,
        controls_html: html_toolbar
    });
    $('#product_form input[name=name]').bind('keyup', function() {
        $('#product_form input[name=path]').val($(this).val().replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]/g, '-').toLowerCase());
    });
});