text: function refreshCollection(){$.get("refresh/"+$('select[name="user"]').val())}function searchCollection(){var e=$("input[name='keyword']").val(),t=$("input[name='format']").val(),n=$("select[name='user']").val(),r=$("input[name='sortBy']").val(),i=$("input[name='sortOrder']").val(),s=$("#owned").is(":checked")?1:0,o=$("#trade").is(":checked")?1:0,u=$("#wishlist").is(":checked")?1:0,a=$("#toplay").is(":checked")?1:0,f=$("#preordered").is(":checked")?1:0;$.get("search",{keyword:e,format:t,user:n,sortBy:r,sortOrder:i,owned:s,trade:o,wishlist:u,toplay:a,preordered:f},function(e){$(".game-stats").hide();$(".search-results").html(e)})}function sortResults(e){var t=$('input[name="sortOrder"]').val(),n=$('input[name="sortBy"]').val();n!==e?$('input[name="sortOrder"]').val("asc"):t==="asc"?$('input[name="sortOrder"]').val("desc"):$('input[name="sortOrder"]').val("asc");$('input[name="sortBy"]').val(e);searchCollection()}$("document").ready(function(){var e=null;$(".refresh").click(function(){refreshCollection()});$("input[name='search']").click(function(){searchCollection()});$("input[name='keyword']").focus().keyup(function(){clearTimeout(e);e=setTimeout(function(){searchCollection()},400)});$(".thumbview").click(function(){$('input[name="format"]').val("thumbnail");searchCollection()});$(".gridview").click(function(){$('input[name="format"]').val("grid");searchCollection()});$(".toolbar-form").on("submit",function(e){e.preventDefault()});$(".toolbar-filters input").click(function(){searchCollection()})});