var slug = function(str) { str = str.replace(/^\s+|\s+$/g, ''); // trim str = str.toLowerCase(); // remove accents, swap ñ for n, etc var from = "ąãàáäâęẽèéëêìíïîõòóöôùúüûńñçćżźśł·/_,:;"; var to = "aaaaaaeeeeeeiiiiooooouuuunncczzsl------"; for (var i=0, l=from.length ; i 0 ) { $('#file-manager').dialog({ width: 'auto', height: 'auto', title: 'CMS Editor', modal: true, autoOpen: false, resize: function( event, ui ) { $(this).dialog("option", "position", ['center', 'center'] ); }, beforeClose: function() { window.location = window.location; } }); } });