
   if(!dbugScripts("commerce",["commerce.tron.giftguide2010landing.js"])) {
   /*	commerce.tron.giftguide2010landing.js - packed	*/
       var ThumbScroller=new Class({Extends:Fx.Scroll,scrollOptions:{thumbs:".box",axis:"x",thumbContainer:null,nav:{},startIndex:0,tolerance:0},initialize:function(A,B){if($(A).retrieve("thumbscroller")){return false;}this.parent(A,$merge(this.scrollOptions,B));this.element.store("thumbscroller",this);this.element.setStyle("overflow","hidden");this.computeDimensions();this.initNav();this.toIndex(this.options.startIndex);this.lastScroll=null;this.fireEvent("onInitialize");return this;},computeDimensions:function(){this.thumbs=this.element.getElements(this.options.thumbs);this.setParentSize();this.positions=this.getLocations();return this;},isAtEnd:function(A){A=A||this.getRange();var B=A[A.length-1];return(B.index==this.thumbs.length-1&&(B.type!="partial"||B.tolerated));},isAtStart:function(A){A=A||this.getRange();var B=A[0];return(B.index==0&&(B.type!="partial"||B.tolerated));},getLocations:function(){return this.thumbs.map(function(B){var C=B.getComputedSize()[this.getDir("total")];var A=B.getPosition(B.getParent())[this.getDir("xy")];return{size:C,start:A,end:C+A};},this);},initNav:function(){$$(this.options.nav.next).addEvent("click",this.toNextScreen.bind(this));$$(this.options.nav.previous).addEvent("click",this.toPreviousScreen.bind(this));$$(this.options.nav.start).addEvent("click",this.toStart.bind(this));$$(this.options.nav.end).addEvent("click",this.toEnd.bind(this));},getDir:function(A){switch(A){case"total":if(this.options.axis=="y"){return"totalHeight";}return"totalWidth";case"dir":if(this.options.axis=="y"){return"height";}return"width";case"xy":default:if(this.options.axis=="y"){return"y";}return"x";}},getStart:function(A){if(this.options.axis=="y"){return[0,A];}return[A,0];},getStartPx:function(A){if(!A){return 0;}return this.positions[A].start-(this.positions[A].start-this.positions[A-1].end);},setParentSize:function(){var A=(this.options.thumbContainer)?this.element.getElement(this.options.thumbContainer):this.element.getElement(this.options.thumbs).getParent();var B=0;$each(this.thumbs,function(C){B+=C.getComputedSize({styles:["padding","border","margin"]})[this.getDir("total")];},this);A.setStyle(this.getDir("dir"),B);},getRange:function(E){E=E||this.element.getScroll()[this.getDir("xy")];var D=this.element.getComputedSize({styles:["padding"]})[this.getDir("total")];var C=[];for(var A=0;A<this.positions.length;A++){var B=this.withinRange(this.positions[A],E,E+D);if(B){C.push($merge(B,{index:A}));if(B.where=="end"){break;}}}return C;},withinRange:function(C,B,A){if(C.end>B&&C.end<=A){if(C.start>=B){return{type:"full"};}else{return{type:"partial",where:"start",tolerated:((B-C.start)<=this.options.tolerance)};}}else{if(C.start>=B&&C.start<A){return{type:"partial",where:"end",tolerated:((C.start-A)<this.options.tolerance)};}else{if(C.start<B&&C.end>A){return{type:"full"};}}}return false;},toNextScreen:function(){var A=this.getRange();if(A.getLast().type=="partial"&&!A.getLast().tolerated&&A.length>1){this.start.run(this.getStart(this.getStartPx(A.getLast().index)),this);}else{if($(this.thumbs[A.getLast().index+1])){this.start.run(this.getStart(this.getStartPx(A.getLast().index+1)),this);}else{this.toEnd();}}this.lastScroll="next";},toPreviousScreen:function(){var A=this.getRange();var C=(A[0].type=="partial"&&!A[0].tolerated&&A.length>1)?A[0].index:A[0].index-1;if(!this.positions[C]){this.toStart();return ;}var B=this.positions[C].end-this.element.getComputedSize({styles:["padding"]})[this.getDir("total")];var E=this.getRange(B);var D=(E[0].type=="partial"&&E.length>1)?E[0].index+1:E[0].index;this.start.run(this.getStart(this.getStartPx(D)),this);this.lastScroll="previous";},toIndex:function(A){this.start.run(this.getStart(this.getStartPx(parseInt(A))),this);},toStart:function(){if(this.options.axis=="y"){this.toTop();}else{this.toLeft();}},toEnd:function(){if(this.options.axis=="y"){this.toBottom();}else{this.toRight();}}});var CBSCarousel=new Class({Implements:[Options,Events],options:{slide$$:"li.carouselSlide",slideInterval:6000,transitionDuration:"short",startIndex:0,indicatorActiveClass:"selected",indicatorInactiveClass:"off",indicatorDisplayStart:0,rotateAction:"mouseenter",rotateActionDuration:100,autoplay:true,useIndicators:true,indicatorContainerClass:"indicators",indicator$$:null,nextButtonClass:"carouselNext",prevButtonClass:"carouselPrev",pauseOnHover:true,pauseOnBlur:true},initialize:function(A,B){A=$(A);if(A.retrieve("carousel")){return false;}this.container=A;this.container.store("carousel",this);this.setOptions(B);this.slides=this.setSlides();if(this.options.useIndicators){this.setIndicators();}this.showSlide(this.options.startIndex);this.setButtons();if(this.options.pauseOnHover&&this.options.autoplay){this.setHoverPausing();}if(this.options.pauseOnBlur&&this.options.autoplay){this.setWindowPausing();}if(this.options.autoplay){this.autoplay();}this.fireEvent("onInitialize");return this;},setHoverPausing:function(){this.setBindings();this.container.addEvents({mouseenter:this.bound.stop,mouseleave:this.bound.autoplay});this.addEvent("onActiveSelect",this.bound.clearPausing);},setWindowPausing:function(){if(!this.bound){this.setBindings();}window.addEvents({blur:this.bound.stop,focus:this.bound.autoplay});},clearPausing:function(){this.container.removeEvent("mouseenter",this.bound.stop);this.container.removeEvent("mouseleave",this.bound.autoplay);window.removeEvent("blur",this.bound.stop);window.removeEvent("focus",this.bound.autoplay);this.removeEvent("onActiveSelect",this.bound.clearPausing);},setBindings:function(){this.bound={autoplay:this.autoplay.bind(this),stop:this.stop.bind(this),clearPausing:this.clearPausing.bind(this)};},setSlides:function(){slides=this.container.getElements(this.options.slide$$);slides.each(function(A,B){A.set("tween",{duration:this.options.transitionDuration,onStart:function(){if(A.getStyle("opacity")<0.1){A.setStyle("display","block");}},onComplete:function(){if(A.getStyle("opacity")<1){A.setStyle("display","none");}}});A.setStyles({display:(B==this.options.startIndex)?"block":"none",opacity:(B==this.options.startIndex)?1:0});}.bind(this));return slides;},setIndicators:function(){this.indicators=(this.options.indicator$$)?this.container.getElements(this.options.indicator$$):this.createIndicators();this.indicators.each(function(A,B){A.addEvent(this.options.rotateAction,this.activeSelect.bind(this,B));},this);},createIndicators:function(){var C=this.options,A=new Element("ul",{"class":C.indicatorContainerClass}).inject(this.container);var D=[];for(var B=0;B<this.slides.length;B++){D.push(new Element("li",{text:B+(C.indicatorDisplayStart||0)}).inject(A));}return D;},setButtons:function(){this.container.getElements("."+this.options.nextButtonClass).removeProperties("onclick","href").addEvent("click",this.activeSelect.bind(this,"next"));this.container.getElements("."+this.options.prevButtonClass).removeProperties("onclick","href").addEvent("click",this.activeSelect.bind(this,"prev"));},activeSelect:function(A){if($type(A)!="number"){A=this.getToIndex(A);}if(this.slideshowInt){this.stop();}this.showSlide(A);this.fireEvent("onActiveSelect");},getToIndex:function(A){if(A=="next"){return(this.currentIndex==this.slides.length-1)?0:this.currentIndex+1;}return((this.currentIndex==0)?this.slides.length:this.currentIndex)-1;},showSlide:function(A){if(A==this.currentIndex){return this;}$each(this.slides,function(B,C){if(C==A){if(this.options.useIndicators){this.indicators[C].swapClass(this.options.indicatorInactiveClass,this.options.indicatorActiveClass);}B.fade("in");}else{if(this.options.useIndicators){this.indicators[C].swapClass(this.options.indicatorActiveClass,this.options.indicatorInactiveClass);}B.fade("out");}}.bind(this));this.fireEvent("onShowSlide",[A,this.currentIndex]);this.currentIndex=A;return this;},autoplay:function(){if(this.slideshowInt){return this;}this.slideshowInt=this.rotate.periodical(this.options.slideInterval,this);this.fireEvent("onAutoPlay");return this;},stop:function(){this.slideshowInt=$clear(this.slideshowInt);this.fireEvent("onStop");return this;},rotate:function(){var B=this.currentIndex;var A=(B+1>=this.slides.length)?0:B+1;this.showSlide(A);this.fireEvent("onRotate",[A,B]);return this;},toElement:function(){return this.container;}});var MadCookieSession=new Class({Implements:Options,options:{cookieVar:"CNET_SESSION",madisonCookie:"MAD_SESSION",sessionSeats:6},initialize:function(A){this.setOptions(A);dbug.log("initialize");var B=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];var C=null;if(this.options.sessionSeats>B.length){this.options.sessionSeats=6;}C=B.splice(0,this.options.sessionSeats);dbug.log(C);if(!Cookie.read(this.options.madisonCookie)||(Cookie.read(this.options.madisonCookie)!=Cookie.read(this.options.cookieVar))){dbug.log("Cookie: "+this.options.madisonCookie+" doesnt existwriting cookie for "+this.options.cookieVar);Cookie.write(this.options.cookieVar,C.getRandom());Cookie.write(this.options.madisonCookie,Cookie.read(this.options.cookieVar));}return this;}});var CnetDoorCarousel=new Class({Implements:StyleWriter,initialize:function(){if($$(".macInteraction").length){this.createStyle("#rubicsTextAd {display:none !important;}","hideRubics");}this.carousel=new CBSCarousel("carouselMain",{slide$$:".slide",slideInterval:4000,autoplay:false,transitionDuration:700,indicatorContainerClass:"#carouselMain .thumbContainer",indicator$$:".featureButton"});window.addEvent("domready",this.startCarousel.bind(this));},startCarousel:function(){var A=$$(".macInteraction"),C,B;A.each(function(D){var E;if(!C&&!B){if(E=D.getProperty("mac-interaction-stop")){B=true;}if(E=D.getProperty("mac-interaction-carousel")){C=E;}}});if(C){this.carousel.options.slideInterval=C.toInt();}if(!B){this.carousel.autoplay();}}});window.addEvent("domready",function(){if($("imgThumbContainer0")){new ThumbScroller("imgThumbContainer0",{axis:"x",thumbs:".thumb",nav:{next:$$(".thumbScroller .scrollingArrows .next"),previous:$$(".thumbScroller .scrollingArrows .previous")}}).addEvent("onComplete",function(){$$(this.options.nav.previous).setStyle("opacity",((this.isAtStart())?".3":"1"));$$(this.options.nav.next).setStyle("opacity",((this.isAtEnd())?".3":"1"));}).fireEvent("onComplete");}if($("imgThumbContainer3")){new ThumbScroller("imgThumbContainer3",{axis:"x",thumbs:".thumb",nav:{next:$$(".thumbScroller .scrollingArrows .next"),previous:$$(".thumbScroller .scrollingArrows .previous")}}).addEvent("onComplete",function(){$$(this.options.nav.previous).setStyle("opacity",((this.isAtStart())?".3":"1"));$$(this.options.nav.next).setStyle("opacity",((this.isAtEnd())?".3":"1"));}).fireEvent("onComplete");}if($("videoHub")){var A=$$(".videoPlayer")[0];$lazy(window.GeckoVideoPlayer,CBSi.lazy.videoPlayer,function(){loadGeckoVideoPlayer({parentElement:A,flashVars:{autoplay:false,contentType:"videoId",contentValue:$("videoHub").getProperty("videoId"),adTargetType:"Page",adPostroll:"true",adPreroll:"false"}},"blogLarge");});}$$(".contentTools a.share").each(function(B){B.addEvent("mouseenter",PageTools.openShare.bind(PageTools));});new MadCookieSession({cookieVar:"HGG_SESSION",sessionSeats:11});});
   }
       
