// JavaScript Document
function change(n){
	n = n.selectedIndex;
	
	var newList = $('#shoplist li').sort(function(a,b){
		if(a.title == b.title){
			if(n == 0){
				return a.id > b.id;
			}else if(n == 1){
				return a.id < b.id;
			}
		}else {
			if(n == 0){
				return a.title > b.title;
			}else if(n == 1){
				return a.title < b.title;
			}
		}
	});
	$('#shoplist').append(newList);
	
}
$(function(){
	change(0);
});

