
(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var self=this;self.running=false;var animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var div=$(this),ul=$(this).find("ul.carousel:visible",div),tLi=$(this).find("li.carousel-item",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v;}
var li=$(ul).find("li.carousel-item",ul),itemLength=li.size(),curr=o.start;div.css("visibility","visible");li.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});div.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var liSize=o.vertical?height(li):width(li);var ulSize=liSize*itemLength;var divSize=liSize*v;li.css({width:li.width(),height:li.height()});ul.css(sizeCss,ulSize+"px").css(animCss,-(curr*liSize));div.css(sizeCss,divSize+"px");if(o.btnPrev)
$(o.btnPrev).click(function(){if(!$(this).hasClass('disabled')){return go(curr-o.scroll);}});if(o.btnNext)
$(o.btnNext).click(function(){if(!$(this).hasClass('disabled')){return go(curr+o.scroll);}});if(o.btnGo)
$.each(o.btnGo,function(i,val){$(val).click(function(){if(!$(this).parent().hasClass('disabled')){return go(o.circular?o.visible+i:i);}else{return false;}});});if(o.mouseWheel&&div.mousewheel)
div.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll);});if(o.auto)
setInterval(function(){go(curr+o.scroll);},o.auto+o.speed);function vis(){return li.slice(curr).slice(0,v);};function go(to){if(!self.running){if(o.beforeStart)
o.beforeStart.call(this,vis());if(o.circular){if(to<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*liSize)+"px");curr=to==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll;}else if(to>=itemLength-v+1){ul.css(animCss,-((v)*liSize)+"px");curr=to==itemLength-v+1?v+1:v+o.scroll;}else curr=to;}else{if(to<0||to>itemLength-v)return;else curr=to;}
if(ul.is(':visible')){self.running=true;$(self).addClass("active");ul.animate(animCss=="left"?{left:-(curr*liSize)}:{top:-(curr*liSize)},o.speed,o.easing,function(){if(o.afterEnd)
o.afterEnd.call(this,vis());self.running=false;$(self).removeClass("active");});}
if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled");}}
return false;};});};function css(el,prop){return parseInt($.css(el[0],prop))||0;};function width(el){return el[0].offsetWidth+css(el,'marginLeft')+css(el,'marginRight');};function height(el){return el[0].offsetHeight+css(el,'marginTop')+css(el,'marginBottom');};})(jQuery);(function($){G4TV.ui.Playlist={playListTriggers:null,init:function(){this.initEvents();},initEvents:function(){var self=this;$('.icn-plylst').bind('click',function(event){self.add();event.preventDefault();})},add:function(){},remove:function(){}};})(jQuery);(function($){G4TV.ui.mod.Videos=function(el,config){var VID_ELEMENTS={'PLAYER':'.video-player','DIMMER':'.dimmer','CLOSE_BTN':'.close','VIDEO_TITLE':'.video-info'};var vidUrl;var vidId;var nextVideo;var allowHide=false;var self=this;var interval;this.initEvents=function(){$(self.el).find('ul.tabs li a').bind('click',function(){self.hidePlayer();});this.playedVids=[];self.superclass.prototype.initEvents.apply(self);self.oVidContainer=$(self.el).parents('div.vid-mod-wrap').find('.video-player');self.oDimmer=$(self.el).find(VID_ELEMENTS.DIMMER);$(self.el).find('.carousel-item-wrap').live('click',function(event){if(event.button!==2){if(!$(event.target).hasClass('icn-plylst')){aElem=$(this).find('a');self.vidUrl=aElem.attr('href');self.vidId=aElem.attr('rel').replace('video-','');self.allowHide=false;self.showPlayer();event.preventDefault();return false;}}});$(self.el).find(VID_ELEMENTS.CLOSE_BTN).unbind().bind('click',function(){$(this).hide();self.hidePlayer();G4TV.ui.gbl.overlay.hide();return false;});};this.showPlayer=function(){self.allowHide=false;$(self.el).find('.carousel-pagination').fadeTo('fast','.20');$(self.el).find(VID_ELEMENTS.CLOSE_BTN).show();self.oDimmer.show().fadeTo('fast','.85',function(){self.oVidContainer.addClass('open');$(self.el).find(VID_ELEMENTS.CLOSE_BTN).show();setTimeout(function(){$(self.el+'_video-player')[0].showPlayer();},250);self.attachVideo();});$(self.el).find(self.superclass.MODULE_ELEMENTS.CAROUSEL_PAGINATION).addClass('disabled');$(self.el).find(self.superclass.MODULE_ELEMENTS.CAROUSEL_PREV).addClass('disabled');$(self.el).find(self.superclass.MODULE_ELEMENTS.CAROUSEL_NEXT).addClass('disabled');return false;};this.hidePlayer=function(){var self=this;$(self.el).find('.carousel-pagination').fadeTo('fast','100');if(self.allowHide){$(self.el+'_video-player')[0].stopVideo();$(self.el+'_video-player')[0].hidePlayer();self.oVidContainer.removeClass('open');self.oDimmer.fadeTo('normal',0,function(){$(this).hide();});$(self.el).find(self.superclass.MODULE_ELEMENTS.CAROUSEL_PAGINATION).removeClass('disabled');$(self.el).find(self.superclass.MODULE_ELEMENTS.CAROUSEL_PREV).removeClass('disabled');$(self.el).find(self.superclass.MODULE_ELEMENTS.CAROUSEL_NEXT).removeClass('disabled');}};this.attachVideo=function(){var self=this;self.oVidContainer.addClass('open');$(self.el+'_video-player')[0].changeVideo(self.vidId);setTimeout(function(){self.allowHide=true;},100);this.playedVids[self.vidId]=true;var videos=[];$(this.el+' ul.selected div.carousel-item-wrap a.video-cell').each(function(i,vid){videos[$(this).attr('rel').replace('video-','')]=true;});var nextVid=false;for(var vid in videos){if(nextVid&&typeof(this.playedVids[vid])=='undefined'){this.nextVideo=vid;break;}
else if(nextVid){this.hidePlayer();break;}
if(vid==this.vidId){nextVid=true;}}};this.playNextVideo=function(){this.vidId=self.nextVideo;this.attachVideo();};this.attachTitleEvents=function(){var vids=$(self.el).find('div.carousel-item-wrap');var vidTitles=$(self.el).find(VID_ELEMENTS.VIDEO_TITLE);var grow=function(){var oLink=$(this).find('h4'+VID_ELEMENTS.VIDEO_TITLE+' a')[0];var linkHeight=oLink.offsetHeight;if(linkHeight>34){$(oLink).parent().animate({height:51},'fast',function(){$(this).css('overflow','visible');});}};var shrink=function(){var oLink=$(this).find('h4'+VID_ELEMENTS.VIDEO_TITLE+' a')[0];$(oLink).parent().animate({height:38},'fast',function(){$(this).css('overflow','hidden');});};var hoverConfig={sensitivity:2,interval:100,over:grow,timeout:100,out:shrink};$(vids).hoverIntent(hoverConfig);}
this.attachTitleEvents();this.superclass.apply(this,arguments);};jQuery.Class.extend(G4TV.ui.mod.Videos,G4TV.ui.Module);})(jQuery);(function($){G4TV.ui.Carousel3D=function(carousel,config){if(carousel){this.init(carousel,config);}else{console.warn('Element'+carousel+'does not exist on page');}};var Carousel=G4TV.ui.Carousel3D;Carousel.ELS={'BTN_PREV':'.carousel-prev','BTN_NEXT':'.carousel-next'};Carousel.ITEM_PROPS={'ITEM_1':{'DIMS':[71,101],'ABS_POS':["22px","26px"],'ZINDEX':3},'ITEM_2':{'DIMS':[80,114],'ABS_POS':["17px","63px"],'ZINDEX':4},'ITEM_3':{'DIMS':[100,143],'ABS_POS':["0","100px"],'ZINDEX':5},'ITEM_4':{'DIMS':[80,114],'ABS_POS':["17px","153px"],'ZINDEX':4},'ITEM_5':{'DIMS':[71,101],'ABS_POS':["22px","199px"],'ZINDEX':3},'ITEM_6':{'DIMS':[71,101],'ABS_POS':["22px","199px"],'ZINDEX':3}};G4TV.ui.Carousel3D.prototype={constructor:Carousel,userConfig:{},itemsLength:null,visibleItemsLength:5,lastItem:null,lastVisibleItem:null,spotlightedItem:null,scrollInProgress:false,init:function(carousel,config){this.carousel=carousel;this.userConfig=config;},initEvents:function(){var self=this;$(this.carousel).parent().find(Carousel.ELS.BTN_PREV).bind('click',function(){self.scroll.call(self,'scrollLeft')});$(this.carousel).parent().find(Carousel.ELS.BTN_NEXT).bind('click',function(){self.scroll.call(self,'scrollRight')});jQuery.each(this.items(),function(i){$(this).bind('click',function(event){self.handleCoverClicks.apply(self,[$(this),event]);});});},render:function(){var self=this;jQuery.each(this.items(),function(i,item){i=i+1;var pName="ITEM_"+i;if(i<=5){$(item).css('top',Carousel.ITEM_PROPS[pName].ABS_POS[0]).css('left',Carousel.ITEM_PROPS[pName].ABS_POS[1]).css('width',Carousel.ITEM_PROPS[pName].DIMS[0]).css('height',Carousel.ITEM_PROPS[pName].DIMS[1]).css('zIndex',Carousel.ITEM_PROPS[pName].ZINDEX).css('display','block');}else{$(item).css('zIndex',Carousel.ITEM_PROPS.ITEM_5.ZINDEX).css('top',Carousel.ITEM_PROPS.ITEM_5.ABS_POS[0]).css('left',Carousel.ITEM_PROPS.ITEM_5.ABS_POS[1]).css('width',Carousel.ITEM_PROPS.ITEM_5.DIMS[0]).css('height',Carousel.ITEM_PROPS.ITEM_5.DIMS[1]);}
if(i==3){$(item).find('img').css('opacity',100);self.spotlightedItem=item;}});this.itemsLength=this.items().length;this.lastItem=this.items()[this.itemsLength-1];this.lastVisibleItem=this.visibleItems()[this.visibleItems().length-1];this.initEvents();},scroll:function(direction,isCoverScroll,scrollInc){var self=this,opacity;if(self.scrollInProgress)return;self.scrollInProgress=true;var firstItem=this.items()[0];var visibleCnt=0;jQuery.each(this.items(),function(i,item){if(isCoverScroll)
i+=scrollInc;else
i=direction=='scrollLeft'?i+2:i;opacity=i==3?100:.7;var pName="ITEM_"+i;switch(true){case(i<=0):if(self.itemsLength>self.visibleItemsLength){$(item).css('display','none');$(item).hide();pName="ITEM_5";}else{pName="ITEM_"+(self.visibleItemsLength-visibleCnt);visibleCnt+=1;}
$(item).css('zIndex',Carousel.ITEM_PROPS[pName].ZINDEX).css('top',Carousel.ITEM_PROPS[pName].ABS_POS[0]).css('left',Carousel.ITEM_PROPS[pName].ABS_POS[1]).css('width',Carousel.ITEM_PROPS[pName].DIMS[0]).css('height',Carousel.ITEM_PROPS[pName].DIMS[1]);$(item).find('img').css('opacity',opacity);$(item).insertAfter($(self.lastItem));self.lastItem=$(item);break;case(i>=self.visibleItemsLength):if(visibleCnt>=5)break;if(direction=='scrollRight'){visibleCnt+=1;if(visibleCnt==self.visibleItemsLength)
$(item).show(function(){self.setScrollStatus();});else
$(item).show();$(item).find('img').css('opacity',opacity);}else if(direction=='scrollLeft'){if(i>self.visibleItemsLength){pName="ITEM_"+(self.visibleItemsLength-visibleCnt);visibleCnt+=1;if(self.itemsLength>self.visibleItemsLength){$(item).hide();}
var secLast=$(self.lastItem).prev();$(self.lastItem).insertBefore($(firstItem));$(self.lastItem).css('top',Carousel.ITEM_PROPS[pName].ABS_POS[0]).css('left',Carousel.ITEM_PROPS[pName].ABS_POS[1]).css('width',Carousel.ITEM_PROPS[pName].DIMS[0]).css('height',Carousel.ITEM_PROPS[pName].DIMS[1]).css('zIndex',Carousel.ITEM_PROPS[pName].ZINDEX);$(self.lastItem).find('img').css('opacity',opacity);if(visibleCnt==self.visibleItemsLength){$(self.lastItem).show(1,function(){self.setScrollStatus();});}else{$(self.lastItem).show();}
firstItem=$(self.lastItem);self.lastItem=secLast;}else{visibleCnt+=1;self.setAnimation(item,pName,visibleCnt);$(item).find('img').css('opacity',opacity);}}
break;default:try{if(i<self.visibleItemsLength){visibleCnt+=1;if(!$(item).is(':visible'))
$(item).css('display','block');self.setAnimation(item,pName,visibleCnt);$(item).find('img').css('opacity',opacity);}}catch(e){console.warn(e);}
break;}
if(i==3){self.spotlightedItem=item;}});var lastItemIndex=self.itemsLength-1;self.lastItem=self.items()[lastItemIndex];var lastVisibleItemIndex=self.visibleItems().length-1;self.lastVisibleItem=self.visibleItems()[lastVisibleItemIndex];if(jQuery.isFunction(self.userConfig.onScroll)){self.userConfig.onScroll.apply(self);}},handleCoverClicks:function(item,event){var self=this;var itemPosition;var numScroll;for(var i=0;i<this.visibleItems().length;i++){var vImg=$(this.visibleItems()[i]).find("img");var iImg=$(item).find("img");if(vImg.attr("src")==iImg.attr("src")){itemPosition=i;break;}}
if(itemPosition==2)return;event.preventDefault();numScroll=3-itemPosition;if(itemPosition>2){this.scroll('scrollRight',true,numScroll);}else{this.scroll('scrollLeft',true,numScroll);}},setAnimation:function(item,pName,visibleCnt){var speed=($.browser.msie)?1000:600;var self=this;if(visibleCnt==self.visibleItemsLength){$(item).css('zIndex',Carousel.ITEM_PROPS[pName].ZINDEX).animate({'top':Carousel.ITEM_PROPS[pName].ABS_POS[0],'left':Carousel.ITEM_PROPS[pName].ABS_POS[1],'width':Carousel.ITEM_PROPS[pName].DIMS[0],'height':Carousel.ITEM_PROPS[pName].DIMS[1]},{duration:speed,easing:'swing',queue:false,complete:function(){self.setScrollStatus();}});}else{$(item).css('zIndex',Carousel.ITEM_PROPS[pName].ZINDEX).animate({'top':Carousel.ITEM_PROPS[pName].ABS_POS[0],'left':Carousel.ITEM_PROPS[pName].ABS_POS[1],'width':Carousel.ITEM_PROPS[pName].DIMS[0],'height':Carousel.ITEM_PROPS[pName].DIMS[1]},{duration:speed,easing:'swing',queue:false});}},setScrollStatus:function(){var self=this;window.setTimeout(function(){self.scrollInProgress=false;},200);},items:function(){return $(this.carousel).find('li.carousel-item');},visibleItems:function(){return $(this.carousel).find('li.carousel-item:visible');}};})(jQuery);(function($){G4TV.ui.mod.NewReleases=function(el,config){var self=this;var carousel=$(self.el).find('.carousel-3d');this.renderCarousel=function(){var carousel3D=new G4TV.ui.Carousel3D(carousel,{onScroll:function(){$(self.el).find('.carousel-item-details').html($(carousel3D.spotlightedItem).find('.details').html());self.attachCluetip();}});carousel3D.render();self.attachCluetip();};this.updateCarousel=function(){var ajaxRes=$(self.el+' div.ajax-response');curList=$(self.el).find('ul.content-list li.carousel-item');ajaxRes.find('ul.content-list li.carousel-item').each(function(i,item){itemId='#'+$(item).attr('id');$(itemId).html($(item).html());$(itemId).attr('class',$(item).attr('class'));});ajaxRes.remove();items=$.makeArray($(self.el+' ul.content-list li.carousel-item:visible'));if(items.length>0){$(items[2]).find('img').fadeTo('fast',100);$(self.el).find('div.carousel-item-details').html($(items[2]).find('div.details').html());}
self.attachCluetip();};this.attachCluetip=function(){var tipLinks=$(self.el).find('.carousel-item-details').find('.game');var settings=G4TV.gbl.defaults[0]['simpleTipSettings'];settings.parentClass='tooltip game';jQuery.each(tipLinks,function(){var content=$(this).closest('.carousel-item-details').find('.tooltip-content:first');if(content.length>0){var tooltip=$(this).simpletip(content.html(),settings);}});$('.tooltip.game').append('<div class="arrow"></div><div class="btm"></div><div class="rt"></div><div class="crnr"></div>');}
this.functs={};this.functs.renderCarousel=this.renderCarousel;this.functs.attachClueTip=this.attachClueTip;this.functs.updateCarousel=this.updateCarousel;this.superclass.apply(this,arguments);};jQuery.Class.extend(G4TV.ui.mod.NewReleases,G4TV.ui.Module);})(jQuery);(function($){G4TV.ui.mod.Screenshots=function(el,config){var self=this;this.initEvents=function(){this.superclass.prototype.initEvents.apply(this);var isReviewMod=$('body').hasClass('review');var isDetailMod=$('body').hasClass('detail');var isBlog=$('body').hasClass('blog');$(this.el).find('.carousel-item-wrap').each(function(){var screenshotWrap=$(this).find('.screenshot-wrap');var imgLink=screenshotWrap.html();var imgTitle=$(this).find('h4');var platforms=$(this).find('ul.platforms');platforms=platforms.length>0?platforms.html():'';var metaInfo=$(this).find('p.meta-info');metaInfo=metaInfo.length>0?'<p class="meta-info">'+metaInfo.html()+'</p>':'';strHtml='<div class="screenshot-large">'+imgLink;if(imgTitle.length>0){strHtml+="<h4>"+imgTitle.html()+"</h4>";}
if(metaInfo.length>0){strHtml+=metaInfo;}
if(platforms.length>0){strHtml+=platforms;}
screenshotWrap.append(strHtml+"</div>");});if(typeof(this.config.imagesGallery)!=='undefined'){$(this.el).find('.screenshot-large a').click(function(){$(self.el).find('.carousel-item-wrap').removeClass('selected');$(this).parents('.carousel-item-wrap').addClass('selected');var newTitle=$(this).parents('div.screenshot-large').find('h4').text();self.config.imagesGallery.config.vars.gallery=$(this).attr('rel').replace('gallery-','');self.config.imagesGallery.config.page=1;self.config.imagesGallery.update(function(){$(self.config.imagesGallery.el).find('.hd h3').text(newTitle);self.config.imagesGallery.resetSortMenus();});return false;});}
var itemWraps=$(self.el).find('.screenshot-container');var rows=$(self.el).find('.carousel-row');var grow=function(){var screenshot=$(this).find('.screenshot-large');if(jQuery.browser.safari){var leftPos=$(screenshot).closest('.carousel-item-wrap').attr('offsetLeft');var rowLeftPos=$(screenshot).closest('.carousel-row').attr('offsetLeft');if(leftPos==rowLeftPos){$(screenshot).css('left',0);}
if(leftPos-rowLeftPos==453){if(isReviewMod||isDetailMod)
$(screenshot).css('left','-69px');else
$(screenshot).css('left','-93px');}}else{var parentLeftPos=$(screenshot).closest('li')[0].getBoundingClientRect().left;var leftPos=$(this).closest('.carousel-item-wrap')[0].getBoundingClientRect().left
var parentRightPos=$(screenshot).closest('li')[0].getBoundingClientRect().right;var rightPos=$(this).closest('.carousel-item-wrap')[0].getBoundingClientRect().right
var diff=(isReviewMod||isDetailMod)?9:10;if(isBlog)diff=5;if(leftPos==parentLeftPos){$(screenshot).css('left',0);}
if(parentRightPos-diff==rightPos){if(isReviewMod||isDetailMod||isBlog)
$(screenshot).css('left','-78px');else
$(screenshot).css('left','-69px');}}
$(this).closest('.carousel-item-wrap').addClass('on');$(screenshot).show();};var shrink=function(){$(this).find('.screenshot-large').hide();$(this).closest('.carousel-item-wrap').removeClass('on');};var hoverConfig={sensitivity:2,interval:0,over:grow,timeout:0,out:shrink}
if(typeof(this.config.omitHovers)==='undefined'||(typeof(this.config.omitHovers)!=='undefined'&&this.config.omitHovers!=true)){$(itemWraps).hoverIntent(hoverConfig);}}
this.superclass.apply(this,arguments);};jQuery.Class.extend(G4TV.ui.mod.Screenshots,G4TV.ui.Module);})(jQuery);(function($){G4TV.ui.mod.Discussions=function(el,config){this._updateVisibleContentLength=function(contentList){this.visibleContentLength=$(contentList).find(this.superclass.MODULE_ELEMENTS.CONTENT_ITEM+':not(".hidden")').length;};this.hideLastContentItem=function(obj){var assocContentList=$(obj).closest(this.superclass.MODULE_ELEMENTS.MOD_OPTS).next(this.superclass.MODULE_ELEMENTS.CONTENT_LIST);if($(assocContentList).find(this.superclass.MODULE_ELEMENTS.CONTENT_ITEM+':not(".hidden")').length>1){var lastShownItem=$(assocContentList).find(this.superclass.MODULE_ELEMENTS.CONTENT_ITEM+':not(".hidden"):last');$(lastShownItem[0]).toggleClass('hidden');}
this._updateVisibleContentLength(assocContentList);var lastShownItem=$(assocContentList).find(this.superclass.MODULE_ELEMENTS.CONTENT_ITEM+':not(".hidden"):last');$(lastShownItem[0]).addClass('last-item');};this.showNextContentItem=function(obj){var assocContentList=$(obj).closest(this.superclass.MODULE_ELEMENTS.MOD_OPTS).next(this.superclass.MODULE_ELEMENTS.CONTENT_LIST);if($(assocContentList).find(this.superclass.MODULE_ELEMENTS.CONTENT_ITEM+'.hidden').length>0){var firstHiddenItem=$(assocContentList).find(this.superclass.MODULE_ELEMENTS.CONTENT_ITEM+'.hidden:first');var lastShownItem=$(assocContentList).find(this.superclass.MODULE_ELEMENTS.CONTENT_ITEM+':not(".hidden"):last');$(firstHiddenItem[0]).addClass('last-item')
$(firstHiddenItem[0]).toggleClass('hidden');$(lastShownItem[0]).removeClass('last-item');}
this._updateVisibleContentLength(assocContentList);};this.superclass.apply(this,arguments);};jQuery.Class.extend(G4TV.ui.mod.Discussions,G4TV.ui.Module);})(jQuery);G4TV.ui.ThemeManager.darkThemeFlashColors='0xF00F10,0xF00F10,0xff620e,0xffc46f';G4TV.ui.ThemeManager.lightThemeFlashColors='0xD01515,0xD01515,0x083f6f,0x67b0cc';