function doSort(selector, sortType)
{
	var data = new Array();

	$(selector).each(function (n){
		var id = $(this).attr("id");
	
		data.push({
			el: $(this).get(0)
			, price : parseInt($(this).find("#"+id + "_price").val())
			, star : parseInt($(this).find("#"+id + "_star").val())
		})
		
	});

		
	data.sort(function (a, b){
		if (sortType == "priceAsc"){
			return a.price - b.price;
		}
		else if (sortType == "priceDesc"){
			return b.price - a.price;
		}
		else if (sortType == "starAsc"){
			return a.star - b.star;
		}
		else if (sortType == "starDesc"){
			return b.star - a.star;
		}
	})
	


	for (var n=0;n<data.length;n++)
	{
		var obj = data[n];
		var parent = obj.el.parentNode;
		
		parent.removeChild(obj.el);
		parent.appendChild(obj.el);
	}
}