searchCatalog=[ { "gameName":"Mysterious City: Vegas", "gameNameNorm":"mysterious_city_vegas", "gameDesc":"Stake out casino tables and opulent Vegas locations while using your detective skills to uncover over 1000 hidden objects and apprehend a casino thief!", "gameLink":"/games/648050/mysterious_city_vegas", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/648050/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/648050/screenshot2_sm.jpg", "gameId":648050, "gameRank":200.0, "gameSize":52, "gameProductionTime":"", "gameLink":"/games/648050/mysterious_city_vegas", "gameType" : "0 " } , { "gameName":"Saints and Sinners Bingo", "gameNameNorm":"saints_and_sinners_bingo", "gameDesc":"As a new player on the championship bingo circuit, you\'ll need to collect and use lucky charms at just the right time to beat a motley crew of characters who\'ll try every trick to get bingo!", "gameLink":"/games/326150/saints_and_sinners_bingo", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/326150/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/326150/screenshot2_sm.jpg", "gameId":326150, "gameRank":200.0, "gameSize":9, "gameProductionTime":"", "gameLink":"/games/326150/saints_and_sinners_bingo", "gameType" : "2 " } , { "gameName":"Slingo Quest: Hawaii", "gameNameNorm":"slingo_quest_hawaii", "gameDesc":"The classic and addictive combination of Slots and Bingo jets off to the beautiful Hawaiian Islands and takes Slingo to a whole new level.", "gameLink":"/games/578450/slingo_quest_hawaii", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/578450/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/578450/screenshot2_sm.jpg", "gameId":578450, "gameRank":204.09094, "gameSize":25, "gameProductionTime":"", "gameLink":"/games/578450/slingo_quest_hawaii", "gameType" : "0 " } , { "gameName":"Youda Camper", "gameNameNorm":"youda_camper", "gameDesc":"Become a professional campsite owner in this adventurous management game.", "gameLink":"/games/570450/youda_camper", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/570450/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/570450/screenshot2_sm.jpg", "gameId":570450, "gameRank":200.0, "gameSize":19, "gameProductionTime":"", "gameLink":"/games/570450/youda_camper", "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('