searchCatalog=[ { "gameName":"Bella Design", "gameNameNorm":"bella_design", "gameDesc":"It\'s time to open your own fashion boutique!", "gameLink":"/games/833050/bella_design", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/833050/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/833050/screenshot2_sm.jpg", "gameId":833050, "gameRank":200.0, "gameSize":153, "gameProductionTime":"", "gameLink":"/games/833050/bella_design", "gameType" : "0 " } , { "gameName":"Boutique Boulevard", "gameNameNorm":"boutique_boulevard", "gameDesc":"Turn one small clothing store into a runway of fashion.", "gameLink":"/games/780550/boutique_boulevard", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/780550/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/780550/screenshot2_sm.jpg", "gameId":780550, "gameRank":100.0, "gameSize":82, "gameProductionTime":"", "gameLink":"/games/780550/boutique_boulevard", "gameType" : "0 " } , { "gameName":"Cake Mania: Lights, Camera, Action!", "gameNameNorm":"cake_mania_lights_camera_action", "gameDesc":"Return to Jill Evans\' hometown of Bakersfield in Cake Mania: Light, Camera Action! - The fifth chapter in one of the most popular Time Management series of all time!", "gameLink":"/games/693150/cake_mania_lights_camera_action", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/693150/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/693150/screenshot2_sm.jpg", "gameId":693150, "gameRank":0.0, "gameSize":114, "gameProductionTime":"", "gameLink":"/games/693150/cake_mania_lights_camera_action", "gameType" : "0 " } , { "gameName":"Delicious Deluxe", "gameNameNorm":"delicious_deluxe", "gameDesc":"Help Emily run her newly opened cafe and expand to a chain of 8 restaurants as you put your customer service and multitasking skills to the test in this delightful game!", "gameLink":"/games/761850/delicious_deluxe", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/761850/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/761850/screenshot2_sm.jpg", "gameId":761850, "gameRank":204.46935, "gameSize":14, "gameProductionTime":"", "gameLink":"/games/761850/delicious_deluxe", "gameType" : "0 " } , { "gameName":"Dress Shop Hop", "gameNameNorm":"dress_shop_hop", "gameDesc":"Help Bobbi make fine fashions and keep her customers happy in this Time Management puzzler.", "gameLink":"/games/558350/dress_shop_hop", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/558350/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/558350/screenshot2_sm.jpg", "gameId":558350, "gameRank":200.0, "gameSize":15, "gameProductionTime":"", "gameLink":"/games/558350/dress_shop_hop", "gameType" : "0 " } , { "gameName":"Dress Up Pups", "gameNameNorm":"dress_up_pups", "gameDesc":"Help Pattie deal with ten different clients, each with their own dog and their own special requests, in this hilarious and exciting Match-3 adventure.", "gameLink":"/games/771950/dress_up_pups", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/771950/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/771950/screenshot2_sm.jpg", "gameId":771950, "gameRank":200.0, "gameSize":50, "gameProductionTime":"", "gameLink":"/games/771950/dress_up_pups", "gameType" : "0 " } , { "gameName":"Escape from Thunder Island", "gameNameNorm":"escape_from_thunder_island", "gameDesc":"Help Rita James and her lucky charm, her monkey Marbles, on a dangerous quest to rescue her father who went missing on Thunder Island while looking for the Lost City of Zenadoo!", "gameLink":"/games/736250/escape_from_thunder_island", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/736250/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/736250/screenshot2_sm.jpg", "gameId":736250, "gameRank":200.0, "gameSize":186, "gameProductionTime":"", "gameLink":"/games/736250/escape_from_thunder_island", "gameType" : "0 " } , { "gameName":"Fashion Craze", "gameNameNorm":"fashion_craze", "gameDesc":"Help the fashion-challenged women of the world look their best.", "gameLink":"/games/555850/fashion_craze", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/555850/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/555850/screenshot2_sm.jpg", "gameId":555850, "gameRank":100.0, "gameSize":48, "gameProductionTime":"", "gameLink":"/games/555850/fashion_craze", "gameType" : "0 " } , { "gameName":"Fashion Dash", "gameNameNorm":"fashion_dash", "gameDesc":"Step into the designer shoes of Coco, a young woman with dreams of building a fashion empire.", "gameLink":"/games/595950/fashion_dash", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/595950/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/595950/screenshot2_sm.jpg", "gameId":595950, "gameRank":204.7453, "gameSize":16, "gameProductionTime":"", "gameLink":"/games/595950/fashion_dash", "gameType" : "0 " } , { "gameName":"Fashion Fits", "gameNameNorm":"fashion_fits", "gameDesc":"Help Francie run a fast paced clothing store by stocking tables, cleaning fitting rooms, running customer service, and running the cash register.", "gameLink":"/games/554850/fashion_fits", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/554850/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/554850/screenshot2_sm.jpg", "gameId":554850, "gameRank":200.0, "gameSize":26, "gameProductionTime":"", "gameLink":"/games/554850/fashion_fits", "gameType" : "0 " } , { "gameName":"Go-Go Gourmet: Chef of the Year", "gameNameNorm":"go_go_gourmet_chef_of_the_year", "gameDesc":"Do you have what it takes to be Chef of the Year?", "gameLink":"/games/603950/go_go_gourmet_chef_of_the_year", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/603950/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/603950/screenshot2_sm.jpg", "gameId":603950, "gameRank":200.0, "gameSize":35, "gameProductionTime":"", "gameLink":"/games/603950/go_go_gourmet_chef_of_the_year", "gameType" : "0 " } , { "gameName":"Jigsaw Puzzle Women\'s Day", "gameNameNorm":"jigsaw_puzzle_womens_day", "gameDesc":"A collection of colorful puzzles filled with spring sunlight to warm you and leave you with a bunch of happy memories of spring!", "gameLink":"/games/838350/jigsaw_puzzle_womens_day", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/838350/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/838350/screenshot2_sm.jpg", "gameId":838350, "gameRank":205.73221, "gameSize":134, "gameProductionTime":"", "gameLink":"/games/838350/jigsaw_puzzle_womens_day", "gameType" : "0 " } , { "gameName":"Jigsaw Tour 4", "gameNameNorm":"jigsaw_tour_4", "gameDesc":"Travel around the world with Jigsaw Tour 4!", "gameLink":"/games/830750/jigsaw_tour_4", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/830750/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/830750/screenshot2_sm.jpg", "gameId":830750, "gameRank":203.36763, "gameSize":194, "gameProductionTime":"", "gameLink":"/games/830750/jigsaw_tour_4", "gameType" : "0 " } , { "gameName":"Jojo\'s Fashion Show", "gameNameNorm":"jojos_fashion_show", "gameDesc":"Make stylish outfits from cute tops, elegant dresses and stunning heels as you showcase your fashion sense on runways from New York to Paris.", "gameLink":"/games/594750/jojos_fashion_show", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/594750/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/594750/screenshot2_sm.jpg", "gameId":594750, "gameRank":205.97209, "gameSize":5, "gameProductionTime":"", "gameLink":"/games/594750/jojos_fashion_show", "gameType" : "0 " } , { "gameName":"Jojo\'s Fashion Show 2: Las Cruces", "gameNameNorm":"jojos_fashion_show_2_las_cruces", "gameDesc":"Return to the runway with Jojo for another season of high style, showcasing your fashion sense from L.A. to Berlin.", "gameLink":"/games/601350/jojos_fashion_show_2_las_cruces", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/601350/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/601350/screenshot2_sm.jpg", "gameId":601350, "gameRank":203.11504, "gameSize":53, "gameProductionTime":"", "gameLink":"/games/601350/jojos_fashion_show_2_las_cruces", "gameType" : "0 " } , { "gameName":"Jojo\'s Fashion Show World Tour", "gameNameNorm":"jojos_fashion_show_world_tour", "gameDesc":"Join all the backstage drama as Rosalind Cruz leaves her famous design partnership with her mother Jojo to pursue her own fashion dreams!", "gameLink":"/games/663450/jojos_fashion_show_world_tour", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/663450/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/663450/screenshot2_sm.jpg", "gameId":663450, "gameRank":203.4908, "gameSize":215, "gameProductionTime":"", "gameLink":"/games/663450/jojos_fashion_show_world_tour", "gameType" : "0 " } , { "gameName":"Shangri La Deluxe", "gameNameNorm":"shangri_la_deluxe", "gameDesc":"If you fancy yourself as a bit of a wordsmith, you\'ll love the challenge of this fun Word game and enjoy gorgeous panoramas and soothing melodies!", "gameLink":"/games/764350/shangri_la_deluxe", "gameScreenShot1":"https://img.exent.com/Free/FRG/products/764350/screenshot1_sm.jpg", "gameScreenShot2":"https://img.exent.com/Free/FRG/products/764350/screenshot2_sm.jpg", "gameId":764350, "gameRank":200.0, "gameSize":16, "gameProductionTime":"", "gameLink":"/games/764350/shangri_la_deluxe", "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('
'+boxData.games[0].errorMsg+'
'); $('.pagenation_rib').remove(); return; } for(i=0; i') currentSlide = $(slideContainer).find(".slide:last-child"); } var defaultSlide = ' \
\
\ \
'+game.gameName+'
\
\
'; var premiumGameSlide = ' \
\ \ \
'+game.gameName+'
\ \
\
'; if(game.gameType == 2){ //if premium game $(currentSlide).append(premiumGameSlide); } else{ $(currentSlide).append(defaultSlide); } } genreCatalog_setPagination(); setTimeout( function(){ $(boxData.pagination).find("a,div").click(function() { genreCatalog_loadVisibleImages(); genreCatalog_changeHash(); }); },100); Utils.fixUnloadImages(); } function genreCatalog_setPagination (currentPage) { boxData = genreCatalog_getBoxData(); if (boxData.numberOfGames > boxData.cols*boxData.rows) { $(boxData.box).slides({pagination: true, paginationClass:'paginationGenreCatalog', next:'nextGenreCatalog',prev:'prevGenreCatalog',start:genreCatalog_getHashParam("page")}); $(boxData.pagination).show(); } else { $(boxData.pagination).hide(); } $(boxData.box).find('.slide').width( $(boxData.box).width()+"px" ); } function genreCatalog_reset() { boxData = genreCatalog_getBoxData(); $(boxData.slideContainer).empty(); $(boxData.paginationBulletContainer).empty(); } function genreCatalog_sort(type) { boxData = genreCatalog_getBoxData(); function sortGamesByRank(a,b) { if ( a.gameRank == b.gameRank ) { return a.gameName.localeCompare(b.gameName); } else { return a.gameRank - b.gameRank; } } function sortGamesByName(a,b) { return a.gameName.localeCompare(b.gameName); } if (type == "a-z") { boxData.games.sort(sortGamesByName); } else if (type == "rank") { boxData.games.sort(sortGamesByRank).reverse(); } else { boxData.games.sort(sortGamesByName); } } function genreCatalog_loadVisibleImages () { boxData = genreCatalog_getBoxData(); $(boxData.box).find("img:visible").each(function () { $(this).attr("src",$(this).attr("image-src")); }); } function genreCatalog_changeHash() { hash = ""; boxData = genreCatalog_getBoxData(); currentPage = $(boxData.paginationBulletContainer).find("li").index( $(boxData.paginationBulletContainer).find(".current")[0] )+1; currentSort = $("#genreCatalog_sortOptions li:first").attr("sort"); hash+= ("page="+currentPage); hash+= ("&sort="+currentSort); window.location.hash = hash; } function genreCatalog_getHashParam(paramName) { attributes = window.location.hash.substr(1).split("&"); for (i=0; i 0){ //if the image have the premium styles (class=premiumGameBorder_small) var premiumTitle = $("
FreeRide Club members only
"); $("#genreCatalog_popup .inner_container").prepend(premiumTitle); var playWithoutAdsBtn = $(""); $(playWithoutAdsBtn).insertBefore('#genreCatalog_popup .inner_container .clear'); $("#genreCatalog_popup #genreCatalog_downloadButton .blue_btn_28_left").removeClass("blue_btn_28_left").addClass("yellow_btn_28_left"); $("#genreCatalog_popup #genreCatalog_downloadButton .blue_btn_28_mid").css('color','#0a325f'); $("#genreCatalog_popup #genreCatalog_downloadButton .blue_btn_28_mid").removeClass("blue_btn_28_mid").addClass("yellow_btn_28_middle"); $("#genreCatalog_popup #genreCatalog_downloadButton .blue_download_btn_28_right").removeClass("blue_download_btn_28_right").addClass("yellow_btn_28_right"); } } }