searchCatalog=[ { "gameName":"Wedding Dash", "gameNameNorm":"wedding_dash", "gameDesc":"Help Quinn make wedding bells ring!", "gameLink":"/games/515050/wedding_dash", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/515050/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/515050/screenshot2_sm.jpg", "gameId":515050, "gameRank":200.90604, "gameSize":17, "gameProductionTime":"", "gameLink":"/games/515050/wedding_dash", "gameType" : "0 " } , { "gameName":"Wedding Dash 2 - Rings Around the World", "gameNameNorm":"wedding_dash_2_rings_around_the_world", "gameDesc":"Help Quinn become the world´s top wedding planner in this hilarious sequel to the hit game Wedding Dash®.", "gameLink":"/games/584950/wedding_dash_2_rings_around_the_world", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/584950/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/584950/screenshot2_sm.jpg", "gameId":584950, "gameRank":201.78992, "gameSize":33, "gameProductionTime":"", "gameLink":"/games/584950/wedding_dash_2_rings_around_the_world", "gameType" : "0 " } , { "gameName":"Wedding Dash 3: Ready, Aim, Love!", "gameNameNorm":"wedding_dash_3_ready_aim_love", "gameDesc":"Play the most romantic Dash™ game yet as you help Quinn plan her own wedding!", "gameLink":"/games/641450/wedding_dash_3_ready_aim_love", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/641450/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/641450/screenshot2_sm.jpg", "gameId":641450, "gameRank":203.91183, "gameSize":24, "gameProductionTime":"", "gameLink":"/games/641450/wedding_dash_3_ready_aim_love", "gameType" : "0 " } , { "gameName":"Wedding Dash 4 - Ever", "gameNameNorm":"wedding_dash_4_ever", "gameDesc":"Help Quinn manage more wedding festivities than ever while also managing an unexpected visit from her mother in the most romantic Wedding Dash game yet!", "gameLink":"/games/699150/wedding_dash_4_ever", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/699150/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/699150/screenshot2_sm.jpg", "gameId":699150, "gameRank":203.19855, "gameSize":34, "gameProductionTime":"", "gameLink":"/games/699150/wedding_dash_4_ever", "gameType" : "0 " } ]; $(document).ready(function(){ boxData = genreCatalog_getBoxData(); $("#genreCatalog_sortOptions li").click(function() { // move selected option to be first $(this).parent().prepend( $(this)); genreCatalog_sort( $(this).attr("sort") ); genreCatalog_changeHash(); genreCatalog_render(); genreCatalog_loadVisibleImages(); genreCatalog_setupPopup(); }); $("#genreCatalog_sortOptions li").each(function() { if( $(this).attr("sort") == genreCatalog_getHashParam("sort") ) { $(this).parent().prepend( $(this)); } }); genreCatalog_sort(genreCatalog_getHashParam("sort")); genreCatalog_render(); genreCatalog_loadVisibleImages(); genreCatalog_setupPopup(); }); function genreCatalog_getBoxData() { imageBase = "https://img.exent.com/free/frg/products/%GAME_ID%/boxshot.jpg"; box = $('#genreCatalog'); cols = box.attr("cols"); rows = box.attr("rows"); slideContainer = box.find(".slides_container")[0]; pagination = box.find("div.pagenation") paginationBulletContainer = $(pagination).find("ul"); games = searchCatalog; numberOfGames = games.length; return {imageBase:imageBase, box:box, games:games, slideContainer:slideContainer, cols:cols, rows:rows, numberOfGames:numberOfGames, pagination:pagination, paginationBulletContainer:paginationBulletContainer}; } /** * Destroys the genreCatalog's content, and rebuild it acording to the gamelist */ function genreCatalog_render () { boxData = genreCatalog_getBoxData(); //gameBox_sort() genreCatalog_reset(); if(boxData.games[0].errorMsg!=null){ $("#genreCatalog").append('