searchCatalog=[ { "gameName":"Slingo Quest", "gameNameNorm":"slingo_quest", "gameDesc":"Are you ready for the next Slingo challenge?", "gameLink":"/games/578550/slingo_quest", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/578550/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/578550/screenshot2_sm.jpg", "gameId":578550, "gameRank":202.44681, "gameSize":10, "gameProductionTime":"", "gameLink":"/games/578550/slingo_quest", "gameType" : "0 " } , { "gameName":"Slingo Quest Egypt", "gameNameNorm":"slingo_quest_egypt", "gameDesc":"Brand new power-ups, games modes, awards, and mini-games", "gameLink":"/games/686250/slingo_quest_egypt", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/686250/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/686250/screenshot2_sm.jpg", "gameId":686250, "gameRank":100.0, "gameSize":72, "gameProductionTime":"", "gameLink":"/games/686250/slingo_quest_egypt", "gameType" : "0 " } , { "gameName":"Slingo Quest: Amazon", "gameNameNorm":"slingo_quest_amazon", "gameDesc":"Slingo Quest Amazon takes you on an exciting adventure to discover the new Hex Slingo board, brand new powerups, and other Slingtastic surprises.", "gameLink":"/games/749450/slingo_quest_amazon", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/749450/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/749450/screenshot2_sm.jpg", "gameId":749450, "gameRank":102.23622, "gameSize":79, "gameProductionTime":"", "gameLink":"/games/749450/slingo_quest_amazon", "gameType" : "0 " } , { "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":203.94426, "gameSize":25, "gameProductionTime":"", "gameLink":"/games/578450/slingo_quest_hawaii", "gameType" : "0 " } , { "gameName":"Slingo Supreme", "gameNameNorm":"slingo_supreme", "gameDesc":"Slingo Supreme, the sequel to Slingo Deluxe, takes the game further with additional power-ups, , new challenges, enhanced graphics, sounds and gameplay that are sure to satisfy both seasoned fans and newbies.", "gameLink":"/games/608550/slingo_supreme", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/608550/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/608550/screenshot2_sm.jpg", "gameId":608550, "gameRank":107.55096, "gameSize":21, "gameProductionTime":"", "gameLink":"/games/608550/slingo_supreme", "gameType" : "0 " } , { "gameName":"Slingo Supreme 2", "gameNameNorm":"slingo_supreme_2", "gameDesc":"Uncover the dark scheme of a deceptive criminal in Entwined - Strings of Deception, an elaborate murder mystery. ", "gameLink":"/games/774150/slingo_supreme_2", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/774150/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/774150/screenshot2_sm.jpg", "gameId":774150, "gameRank":200.0, "gameSize":40, "gameProductionTime":"", "gameLink":"/games/774150/slingo_supreme_2", "gameType" : "2 " } , { "gameName":"Word Bird Supreme", "gameNameNorm":"word_bird_supreme", "gameDesc":"A fantastic new game from the makers of Slingo Supreme and Solitaire Kingdom", "gameLink":"/games/778750/word_bird_supreme", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/778750/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/778750/screenshot2_sm.jpg", "gameId":778750, "gameRank":200.0, "gameSize":46, "gameProductionTime":"", "gameLink":"/games/778750/word_bird_supreme", "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('