searchCatalog=[ { "gameName":"Luxor", "gameNameNorm":"luxor", "gameDesc":"The mysterious goddess, Isis, has enlisted you to battle his evil minions", "gameLink":"/games/695150/luxor", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/695150/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/695150/screenshot2_sm.jpg", "gameId":695150, "gameRank":205.90927, "gameSize":14, "gameProductionTime":"", "gameLink":"/games/695150/luxor", "gameType" : "0 " } , { "gameName":"LUXOR - 5th Passage", "gameNameNorm":"luxor_5th_passage", "gameDesc":"Celebrate 5 years of LUXOR with an all-new, marble-shooting adventure!", "gameLink":"/games/710650/luxor_5th_passage", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/710650/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/710650/screenshot2_sm.jpg", "gameId":710650, "gameRank":204.10413, "gameSize":66, "gameProductionTime":"", "gameLink":"/games/710650/luxor_5th_passage", "gameType" : "0 " } , { "gameName":"LUXOR 2 HD", "gameNameNorm":"luxor_2_hd", "gameDesc":"Experience the dazzling action of the hit sequel like never before in Luxor 2 HD, a beautifully enhanced version of the marble shooting game.", "gameLink":"/games/790350/luxor_2_hd", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/790350/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/790350/screenshot2_sm.jpg", "gameId":790350, "gameRank":200.0, "gameSize":130, "gameProductionTime":"", "gameLink":"/games/790350/luxor_2_hd", "gameType" : "2 " } , { "gameName":"Luxor 3", "gameNameNorm":"luxor_3", "gameDesc":"Embark on an ethereal mission using your match-three game playing skills to release the essences of some of the most powerful Egyptian gods of all time.", "gameLink":"/games/586550/luxor_3", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/586550/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/586550/screenshot2_sm.jpg", "gameId":586550, "gameRank":5.7201257, "gameSize":33, "gameProductionTime":"", "gameLink":"/games/586550/luxor_3", "gameType" : "0 " } , { "gameName":"Luxor Adventures", "gameNameNorm":"luxor_adventures", "gameDesc":"Travel to the edge of time and back with the Ancient Egyptian gods!", "gameLink":"/games/659650/luxor_adventures", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/659650/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/659650/screenshot2_sm.jpg", "gameId":659650, "gameRank":0.0, "gameSize":146, "gameProductionTime":"", "gameLink":"/games/659650/luxor_adventures", "gameType" : "0 " } , { "gameName":"Luxor Mahjong", "gameNameNorm":"luxor_mahjong", "gameDesc":"Recover the stolen treasures of Egypt. ", "gameLink":"/games/663250/luxor_mahjong", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/663250/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/663250/screenshot2_sm.jpg", "gameId":663250, "gameRank":209.07135, "gameSize":13, "gameProductionTime":"", "gameLink":"/games/663250/luxor_mahjong", "gameType" : "0 " } , { "gameName":"Luxor: Amun Rising", "gameNameNorm":"luxor_amun_rising", "gameDesc":"Use your scarab to destroy invading spheres before they reach the Pyramids.", "gameLink":"/games/663150/luxor_amun_rising", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/663150/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/663150/screenshot2_sm.jpg", "gameId":663150, "gameRank":209.68694, "gameSize":13, "gameProductionTime":"", "gameLink":"/games/663150/luxor_amun_rising", "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('