function get_posts(n,t){$("."+t).length>0&&$.getJSON("https://blog.gamestop.ie/api/get_recent_posts/?count="+n,function(n){$.each(n.posts,function(){var i,n;post={title:this.title,url:this.url,thumbnail:this.attachments[0].images.medium_large.url,author:this.author.name,comments:this.comment_count,date:new Date(this.date)};i=["January","February","March","April","May","June","July","August","September","October","November","December"];post_day=post.date.getDay(post.date);post_month=post.date.getMonth(post.date);post_year=post.date.getFullYear(post.date);post_hour=post.date.getHours(post.date);post_hour=post_hour+"";post_minute=post.date.getMinutes(post.date);post_minute=post_minute+"";post_minute.length==1&&(post_minute="0"+post_minute);post_hour.length==1&&(post_hour="0"+post_hour);n="";n=post_day==1||post_day==21||post_day==31?"st":post_day==2||post_day==22?"nd":post_day==3||post_day==23?"rd":"th";posted=post_day+n+" "+i[post_month]+" "+post_year+" at "+post_hour+":"+post_minute;$("."+t).append('<div class="grid-25 mobile-grid-50 tablet-grid-25 blog-post"><a title="'+post.title+'" href="'+post.url+'?utm_source=website&utm_medium=html&utm_content=homepage_widget&utm_campaign=blog_links"><div style="background-image:url('+post.thumbnail+'); background-size:cover; background-position: center center; height:120px; display:block;" class="wp-thumb"><\/div><h4 class="wp-title">'+post.title+'<\/h4><span class="wp-meta">Posted by: '+post.author+" <br /> "+posted+"<\/span><\/a><\/div>")})})}(function(n){n.fn.waitUntilExists=function(t,i,r){var f="found",u=n(this.selector),e=u.not(function(){return n(this).data(f)}).each(t).data(f,!0);return r?i&&e.length&&window.clearInterval(window.waitUntilExists_Intervals[this.selector]):(window.waitUntilExists_Intervals=window.waitUntilExists_Intervals||{})[this.selector]=window.setInterval(function(){u.waitUntilExists(t,i,!0)},500),u}})(jQuery),function(n,t){n.fn.quicksearch=function(i,r){var h,c,e,f,o="",s=this,u=n.extend({delay:100,selector:null,stripeRows:null,loader:null,noResults:"",bind:"keyup",onBefore:function(){return},onAfter:function(){return},show:function(){this.style.display=""},hide:function(){this.style.display="none"},prepareQuery:function(n){return n.toLowerCase().split(" ")},testQuery:function(n,t){for(var i=0;i<n.length;i+=1)if(t.indexOf(n[i])===-1)return!1;return!0}},r);return this.go=function(){for(var n=0,t=!0,i=u.prepareQuery(o),r=o.replace(" ","").length===0,n=0,f=e.length;n<f;n++)r||u.testQuery(i,c[n],e[n])?(u.show.apply(e[n]),t=!1):u.hide.apply(e[n]);return t?this.results(!1):(this.results(!0),this.stripe()),this.loader(!1),u.onAfter(),this},this.stripe=function(){if(typeof u.stripeRows=="object"&&u.stripeRows!==null){var t=u.stripeRows.join(" "),i=u.stripeRows.length;f.not(":hidden").each(function(r){n(this).removeClass(t).addClass(u.stripeRows[r%i])})}return this},this.strip_html=function(t){var i=t.replace(new RegExp("<[^<]+>","g"),"");return n.trim(i.toLowerCase())},this.results=function(t){return typeof u.noResults=="string"&&u.noResults!==""&&(t?n(u.noResults).hide():n(u.noResults).show()),this},this.loader=function(t){return typeof u.loader=="string"&&u.loader!==""&&(t?n(u.loader).show():n(u.loader).hide()),this},this.cache=function(){f=n(i);typeof u.noResults=="string"&&u.noResults!==""&&(f=f.not(u.noResults));var t=typeof u.selector=="string"?f.find(u.selector):n(i).not(u.noResults);return c=t.map(function(){return s.strip_html(this.innerHTML)}),e=f.map(function(){return this}),this.go()},this.trigger=function(){return this.loader(!0),u.onBefore(),t.clearTimeout(h),h=t.setTimeout(function(){s.go()},u.delay),this},this.cache(),this.results(!0),this.stripe(),this.loader(!1),this.each(function(){n(this).bind(u.bind,function(){o=n(this).val();s.trigger()})})}}(jQuery,this,document);$("<a href='/Click-&-Collect'><img alt='Click & Collect' src='//www.gamestop.ie/Views/Locale/Content/Images/hp-mini-banners/DeliveryBanner1-IE.jpg'><\/a><br><br><br><br>").insertBefore(".stayConnected h2");$(document).ready(function(){var i,r,u,c;if($("#imgSlider").bxSlider({auto:!0,nextText:"",prevText:"",pause:8e3,autoHover:!0,pager:!1}),$(".cardCarousel").bxSlider({auto:!1,pager:!1,controls:!0,nextText:"",prevText:"",slideWidth:170,minSlides:1,maxSlides:5,slideMargin:10}),$(".lootSlider").bxSlider({auto:!1,nextText:"",prevText:"",minSlides:1,infiniteLoop:!0,autoHover:!0,pager:!1}),$("#intro").bxSlider({pagerCustom:"#intro-pager",controls:!1,autoStart:!1,speed:1e3}),$("a#inline").fancybox({hideOnContentClick:!0}),$(".homeAcc").accordion({heightStyle:"content",activate:function(n,t){var i=$(t.newHeader).offset().top;$("body,html").animate({scrollTop:i})}}),$("#ccs-logos").prependTo("#addedDet"),typeof skin_override=="undefined"&&(skin_override=!1),$("#takeover > div.dynamicSingle").length>0&&skin_override==!1){var n=$("#takeover > div:nth-child(1) > a").attr("href"),f=$("#takeover > div:nth-child(1) > a > img").attr("src"),t=$("#takeover > div:nth-child(1) > a > img").attr("alt");$("body").css("background-image","url('"+f+"')");$("body").css("background-position","top center");$("body").css("background-clip","border-box");$("body").css("background-attachment","fixed");$("body").css("background-origin","padding-box");$("body").css("background-repeat","no-repeat");typeof t!="undefined"&&$("body").css("background-color",t);n!=="undefined"&&$(".footerBuyNow").attr("onclick",'window.location="'+n+'"')}if(document.URL.indexOf("Cart")>=0){var e=["2"],o=["26","27","25","22"],s=["20477","20451","21301","65155","74565"],h=["Digital"];$(".hiddenProductCartInfo").each(function(n,t){var c=$(t).children("input[name=cartProdName]").val(),i=$(t).children("input[name=cartProdPrice]").val(),f=$(t).children("input[name=cartProdSku]").val(),l=$(t).children("input[name=cartProdGenreId]").val(),a=$(t).children("input[name=cartProdGenreGenreCategoryId]").val(),r=$(t).nextAll().eq(2).children(".centeredCart").text();r=$.trim(r);console.log(r);var v=$.inArray(a,e),y=$.inArray(l,o),p=$.inArray(f,s),w=$.inArray(r,h);v===-1&&y===-1&&p===-1&&w===-1})}i=$(".ropisShipMeth").detach();$(".shipgr-0").append(i);$(".carrier-logo").each(function(){var n=$(this).data("carrier-logo");$(this).parent().css({"background-image":"url("+n+")","background-position":"320px 8px","background-repeat":"no-repeat","background-size":"80px"})});r=$(".shipgr-0 > .shipping:nth-child(3)").detach();$(".shipgr-0 > .shipping:nth-child(1)").before(r);u=$(".shipgr-1 > .shipping:nth-child(3)").detach();$(".shipgr-1 > .shipping:nth-child(1)").before(u);$(".shipping").css("position","relative");c=$("#subtotalRow > td.colPrice").text().replace(/[^\d\.]/g,"");$(".shipping > .price").each(function(){var n=$(this).data("price"),t=$(this).data("threshold");t>=n?$(this).parent().append('<span class="displayedShipping" style="color:white; background-color:#686868; font-size: 10px; font-weight:bold; position: absolute; bottom: 3px; display: inline-block; padding: 5px; left: 350px">FREE<\/span>'):$(this).parent().append('<span class="displayedShipping" style="color:white; background-color:#686868; font-size: 10px; font-weight:bold; position: absolute;bottom: 0; display: inline-block; padding: 5px; left: 350px">&euro;'+n+"<\/span>")});$(".shipping").change(function(){var n=$(this).children(".price").data("price")});get_posts(8,"homepage-blog")});$(".secMenuPosition").waitUntilExists(function(){$("#menu > li.Xboxone > div > div > div:nth-child(1)").append('<a href="/XboxLive"><img src="/Views/Locale/Content/Images/xbox-live-platform-bar-logo.png" alt="Xbox Live" title=""><\/a><p class="popButton"><a class="medButton" href="/XboxLive"><span>Xbox Live<\/span><\/a><\/p> ');$("#menu > li.360 > div > div > div:nth-child(1)").append('<a href="/XboxLive"><img src="/Views/Locale/Content/Images/xbox-live-platform-bar-logo.png" alt="Xbox Live" title=""><\/a><p class="popButton"><a class="medButton" href="/XboxLive"><span>Xbox Live<\/span><\/a><\/p> ');$("#menu > li.PlayStation4 > div > div > div:nth-child(1)").append('<a href="/PlayStationPlus"><img src="/Views/Locale/Content/Images/playstation_plus_platform_bar.png" alt="PlayStation Plus" title=""><\/a><p class="popButton"><a class="medButton" href="/PlayStationPlus"><span>PlayStation Plus<\/span><\/a><\/p> ');$("#menu > li.PlayStation3 > div > div > div:nth-child(1)").append('<a href="/PlayStationPlus"><img src="/Views/Locale/Content/Images/playstation_plus_platform_bar.png" alt="PlayStation Plus" title=""><\/a><p class="popButton"><a class="medButton" href="/PlayStationPlus"><span>PlayStation Plus<\/span><\/a><\/p> ')},shouldRunHandlerOnce=!0)