1 function sort(url, old_order, new_order) {
2 var order = getOrderAscDesc(old_order, new_order);
3 location.href = url.replace(old_order, order);
6 function getOrderAscDesc(old_order, new_order) {
7 if (old_order == new_order) {
8 return '-' + old_order;