
   if(!dbugScripts("cnettv",["cnettv.tron.cnetlive.js"])) {
   /*	cnettv.tron.cnetlive.js - packed	*/
       var CNETAPI=new Hash({register:function(C,A){CNETAPI.apps[C]=$merge({apiUrl:"http://api.cnet.com/restApi/v1.0",applicationName:C},A);var B=CNETAPI.apps[C].partKey;if(B){CNETAPI.apps[C].partKey=B.toString();}},retrieve:function(A){return CNETAPI.apps[A];},apps:{},Utils:{}});CNETAPI.register("default");CNETAPI.Utils.Base=new Class({Implements:[Options,Events],options:{applicationName:"default",jsonpOptions:{data:{viewType:"json"}},instantiateResults:false,resultClass:null,errorPath:"CNETResponse.Error.ErrorMessage.$"},initialize:function(A){var B={};this.app=(A&&A.applicationName)?CNETAPI.retrieve(A.applicationName):CNETAPI.retrieve(this.options.applicationName);if(this.app.partKey){B.partKey=this.app.partKey;}if(this.app.partTag){B.partTag=this.app.partTag;}this.setOptions($merge({jsonpOptions:{data:B}},A));},getQuery:function(D,C){C.data=C.data||{};$each(C.data,function(F,E){C.data[E]=$type(F)=="string"?unescape(F):F;});if(this.app.requestUrl){var A=Hash.toQueryString(C.data);C.data={cnetApiRequest:escape(D+"?"+A)};D=this.app.requestUrl;}var B=new JsonP(D||"",C);return B;},packer:function(A){if($type(A)=="array"){A=A.filter(function(B){return B;});}else{if(A){A=[A];}else{A=[];}}if(this.options.instantiateResults&&this.options.resultClass){return A.map(function(B){return new this.options.resultClass(B);},this);}else{return A;}},getMemberByPath:function(B,A){if(A===""||A=="top"||!A){return B;}var C=B;A.split(".").each(function(D){if(D===""){return ;}if(C[D]){C=C[D];}else{C=B;}},this);return(C==B)?false:C;},handleApiResults:function(C,B){var A=this.getMemberByPath(C,this.options.errorPath);return(A)?A:this.getMemberByPath(C,B);},request:function(C,B,E){var A=$merge(this.options.jsonpOptions,{data:C});var D=this.getQuery(this.app.apiUrl+B,A);D.addEvent("onComplete",function(F){F=this.handleApiResults(F,E);if($type(F)=="string"){dbug.log("CNET API Error: ",F);this.fireEvent("onError",[F,D,this]);}else{this.fireEvent("onSuccess",[this.packer(F),D,this]);}this.fireEvent("onComplete",[this.packer(F),D,this]);}.bind(this));D.request();return this;},throwErr:function(B){function A(C){this.message=C;this.name="CNETAPI.Utils Exception:";}A.prototype.toString=function(){return this.name+': "'+this.message+'"';};throw new A(B);}});CNETAPI.Object=new Class({Implements:[Options,Events,Chain],options:{applicationName:"default",extraLookupData:{},type:""},ready:false,initialize:function(B,A){this.setOptions(A);this.app=CNETAPI.retrieve(this.options.applicationName);this.type=this.options.type;B=($type(B)=="array"&&B.length==1)?B[0]:B;if(!B){return ;}if($type(B)=="object"){this.parseData(B);}else{if($type(B)=="number"){this.get(B);}}return ;},get:function(C){try{this.makeLookup().get(C);}catch(A){var B="Error: error on GET: ";dbug.log(B,A);this.fireEvent("onError",B+A.message);}return this;},process:function(B){var A={};$H(B).each(function(D,C){C=this.cleanKey(C);switch($type(D)){case"array":A[C]=D.map(function(E){return this.clean(E,C,C);},this);break;default:A[C]=this.clean(D,C,C);}},this);return A;},cleanKey:function(A){return($type(A)=="string"&&A.test("^@"))?A.substring(1):A;},clean:function(D,B,E){switch($type(D)){case"string":if(D=="false"){D=false;}if(D=="true"){D=true;}if($chk(Number(D))){D=Number(D);}return D;case"function":return D;case"array":return D.map(function(F,G){return this.clean(F,G,E+"."+B);},this);break;default:var A=$H(D);if(D.$&&A.length==1){return D.$;}else{var C={};A.each(function(G,F){F=this.cleanKey(F);if($type(G)=="object"&&G.$&&F.test("url","i")&&G.$.test("restApi")){C.walk=C.walk||{};}C[F]=this.clean(G,F,E+"."+B);},this);return C;}}return this;},makeLookup:function(){return new CNETAPI.Utils[this.options.type]($merge(this.options.extraLookupData,{instantiateResults:false,onError:this.handleError.bind(this),onSuccess:this.parseData.bind(this),applicationName:this.app.applicationName}));},handleError:function(A){this.fireEvent("onError",A);},parseData:function(A){A=($type(A)=="array"&&A.length==1)?A[0]:A;this.json=A;this.data=this.process(A);this.ready=true;this.callChain();this.fireEvent("onSuccess",[this,this.data,this.json]);}});CNETAPI.TechProduct=new Class({Extends:CNETAPI.Object,options:{type:"TechProduct"}});CNETAPI.SoftwareProduct=new Class({Extends:CNETAPI.Object,options:{type:"SoftwareProduct"},getSet:function(C){try{this.makeLookup().getSet(C);}catch(A){var B="Error: error on getSet: ";dbug.log(B,A);this.fireEvent("onError",B+A.message);}return this;}});CNETAPI.Category=new Class({Extends:CNETAPI.Object,options:{type:"Category",siteId:null},initialize:function(B,A){this.children=[];if(A){this.setSiteId(A.siteId);}this.parent(B,A);},setSiteId:function(A){this.setOptions({extraLookupData:{siteId:$chk(A)?A:this.options.siteId}});return this.options.extraLookupData.siteId;},getChildren:function(B,C){var F=function(G){this.children=G.map(function(H){H.options.siteId=D;return H;});this.callChain();}.bind(this);if(this.data.isLeaf){F([]);return this;}B=B||{};var D=this.setSiteId(B.siteId);if(!$chk(D)){var E="Error: you must supply a site id for category lookups.";dbug.log(E);this.fireEvent("onError",E);return null;}else{if(this.data.id){var A=new CNETAPI.Utils[this.options.type]($merge({instantiateResults:true,resultClass:CNETAPI.Category,applicationName:this.app.applicationName},B)).addEvent("onSuccess",F);A.getChildren(this.data.id,$merge(this.options.extraLookupData,C||{}));return this;}else{return null;}}return this;}});CNETAPI.NewsStory=new Class({Extends:CNETAPI.Object,options:{type:"NewsStory"}});CNETAPI.NewsGallery=new Class({Extends:CNETAPI.Object,options:{type:"NewsGallery"}});CNETAPI.BlogEntry=CNETAPI.Object.extend({options:{type:"BlogEntry"}});CNETAPI.Video=CNETAPI.Object.extend({options:{type:"Video"}});CNETAPI.ImageGallery=CNETAPI.Object.extend({options:{type:"ImageGallery"}});CNETAPI.Utils.SearchPaths={TechProduct:"/techProductSearch",NewsGallery:"/newsGallerySearch",NewsStory:"/newsStorySearch",SoftwareProduct:"/softwareProductSearch",BlogEntry:"/blogEntrySearch",Video:"/videoSearch",ImageGallery:"/imageGallerySearch"};CNETAPI.Utils.TechProduct=new Class({Extends:CNETAPI.Utils.Base,options:{resultClass:CNETAPI.TechProduct,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.TechProduct},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.TechProducts.TechProduct");},get:function(B,A){return this.request($merge({productId:B},A),"/techProduct","CNETResponse.TechProduct");},getMany:function(A,B){return this.request($merge({productIds:A},B),"/techProduct","CNETResponse.TechProducts.TechProduct");}});CNETAPI.Utils.SoftwareProduct=new Class({Extends:CNETAPI.Utils.Base,options:{resultClass:CNETAPI.SoftwareProduct,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.SoftwareProduct},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.SoftwareProducts.SoftwareProduct");},getSet:function(B,A){return this.request($merge({productSetId:B},A),"/softwareProduct","CNETResponse.SoftwareProduct");},get:function(B,A){return this.request($merge({productId:B},A),"/softwareProduct","CNETResponse.SoftwareProduct");},getMany:function(A,B){return this.request($merge({productIds:A},B),"/softwareProduct","CNETResponse.SoftwareProducts.SoftwareProduct");},getManySets:function(A,B){return this.request($merge({productSetIds:A},B),"/softwareProduct","CNETResponse.SoftwareProducts.SoftwareProducts");}});CNETAPI.Utils.NewsStory=new Class({Extends:CNETAPI.Utils.Base,options:{resultClass:CNETAPI.NewsStory,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.NewsStory},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.NewsStories.NewsStory");},get:function(B,A){return this.request($merge({storyId:B},A),"/newsStory","CNETResponse.NewsStory");},getMany:function(A,B){return this.request($merge({storyIds:A},B),"/newsStory","CNETResponse.NewsStories.NewsStory");}});CNETAPI.Utils.BlogEntry=new Class({Extends:CNETAPI.Utils.Base,options:{resultClass:CNETAPI.BlogEntry,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.BlogEntry},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.BlogEntries.BlogEntry");},get:function(B,A){return this.request($merge({blogEntryId:B},A),"/blogEntry","CNETResponse.BlogEntries.BlogEntry");},getMany:function(A,B){return this.request($merge({blogEntryIds:A},B),"/blogEntry","CNETResponse.BlogEntries.BlogEntry");}});CNETAPI.Utils.NewsGallery=new Class({Extends:CNETAPI.Utils.Base,options:{resultClass:CNETAPI.NewsGallery,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.NewsGallery},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.NewsGalleries.NewsGallery");},get:function(B,A){return this.request($merge({galleryId:B},A),"/newsGallery","CNETResponse.NewsGallery");},getMany:function(A,B){return this.request($merge({galleryIds:A},B),"/newsGallery","CNETResponse.NewsGalleries.NewsGallery");}});CNETAPI.Utils.Category=new Class({Extends:CNETAPI.Utils.Base,options:{resultClass:CNETAPI.Category,instantiateResults:true,siteId:null,searchPath:CNETAPI.Utils.SearchPaths.TechProduct},packer:function(A){A=this.parent(A);return A.map(function(B){B.options.siteId=this.options.siteId;return B;},this);},get:function(B,A){A=A||{};A.siteId=A.siteId||this.options.siteId;if(!$chk(A.siteId)){dbug.log("You must supply a site id for category lookups");this.throwErr("You must supply a site id for category lookups");}this.options.siteId=A.siteId;return this.request($merge({categoryId:B},A),"/category","CNETResponse.Category");},getMany:function(A,B){return this.request($merge({categoryIds:A},B),"/category","CNETResponse.Categories.Category");},getChildren:function(B,A){A=A||{};A.siteId=A.siteId||this.options.siteId;if(!$chk(A.siteId)){dbug.log("You must supply a site id for category lookups");this.throwErr("You must supply a site id for category lookups");}return this.request($chk(B)?$merge({categoryId:B},A):A,"/childCategories","CNETResponse.ChildCategories.Category");},search:function(C,A,B){B=$merge({results:1,iod:"relatedCats"},B);return this.request($merge({query:C},B),A||this.options.searchPath,"CNETResponse.RelatedCategories");}});CNETAPI.Utils.Video=new Class({Extends:CNETAPI.Utils.Base,options:{resultClass:CNETAPI.Video,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.Video},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.Videos.Video");},get:function(B,A){return this.request($merge({videoId:B},A),"/video","CNETResponse.Video");},getMany:function(A,B){return this.request($merge({videoIs:A},B),"/video","CNETResponse.Videos.Video");}});CNETAPI.Utils.ImageGallery=CNETAPI.Utils.Base.extend({options:{resultClass:CNETAPI.ImageGallery,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.ImageGallery},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.ImageGalleries.ImageGallery");},get:function(B,A){return this.request($merge({galleryId:B},A),"/imageGallery","CNETResponse.ImageGallery");},getMany:function(A,B){return this.request($merge({galleryIds:A},B),"/imageGallery","CNETResponse.ImageGalleris.ImageGallery");}});var LSSC;var LiveStreamStatusCheck=new Class({Implements:[Options,Events],options:{intervalLength:30000,countdown$:"countDownDisplay",apiUrl:"http://api.cnet.com/restApi/v1.0/",franchiseIds:[54,73,72,113,114,92,75,16,134,128],showImages:{13952:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/The404_360x203.jpg",showName:"The 404"},19709:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/bol_360x203.jpg",showName:"Buzz Out Loud"},17918:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/dialedin_360x203.jpg",showName:"Dialed In"},17920:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/CNETRescue_360x203.jpg",showName:"CNET to the Rescue"},30976:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/ReportersRoundtable_360x203.jpg",showName:"Reporters&apos; Roundtable"},17919:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/car_tech_live_360x203.jpg",showName:"Car Tech Live"},18603:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/digitalcity_360x203.jpg",showName:"Digital City"},19736:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/android_atlas_360x203.jpg",showName:"Android Atlas Weekly"},17938:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/crave_360x203.jpg",showName:"Crave"},31329:{imageUrl:"http://i.i.com.com/cnwk.1d/i/tron/cnettv/cnetLive/2/preGAME_360x203.jpg",showName:"preGAME"}}},bound:{},initialize:function(A){this.setOptions(A);this.setPromoElems();this.addRequestHandler();this.initDisplay();},setPromoElems:function(){var A=this.elems={};A.pcPromo=$("pcPromo");A.countdownElem=$(this.options.countdown$)||new Element("div",{id:this.options.countdown$}).inject($("pcPromo"),"before");},initDisplay:function(){var C=this.options,A=(C.broadcastStartTime)?this.findTimeDifference(C.broadcastStartTime)/60:null,B=(C.broadcastEndTime)?this.findTimeDifference(C.broadcastEndTime)/60:null;if(!A||!B){this.findNextLiveStream();return ;}if(["cnetFrontDoor","index"].contains(C.page)){if(C.broadcastStatus=="UPCOMING"){if(A&&A<=60){if(A&&A>0){this.displayPromo();this.startCountdownTimer();return ;}else{if(A<=0){C.broadcastStatus="IN_PROGRESS";}}}else{this.getArchiveVideo();return ;}}if(C.broadcastStatus=="IN_PROGRESS"){this.displayPromo();this.timer=this.findEndOfLiveStream.delay(this.getEndTimeCheck(),this);return ;}else{this.findNextLiveStream();}}else{if(C.page=="show"){if(C.broadcastStatus=="UPCOMING"){if(A&&A<=60){if(A&&A>0){this.startCountdownTimer();}}}else{if(C.broadcastStatus=="IN_PROGRESS"){if(A>-120&&A<0||B<0){this.showRestartLink();}else{this.loadOnDemandPlayer();}}}}}},startCountdownTimer:function(){var B;this.timer=$clear(this.timer);this.timeRemain=this.findTimeDifference(this.options.broadcastStartTime);if(["cnetFrontDoor","index"].contains(this.options.page)){var A="/9776-"+this.options.nodeId+"_53-"+this.options.query+".html";this.elems.showStatus.set("html",'<a href="'+A+'" class="upNext">Coming up next in <span class="timeDisplay"></span></a>');if(this.elems.cat){this.elems.cat.getElement("DIV.showStatus").set("html",'Coming up next in <span class="timeDisplay"></span>');}}else{this.elems.countdown.set("html",'Live stream starts in <span class="timeDisplay"></span>');}B=$$("span.timeDisplay");if(this.options.page=="cnetFrontDoor"){B.setStyle("display","block");}this.timer=this.displayCountdown.periodical(1000,this,[B]);},displayCountdown:function(A){A.set("text",this.getDisplayTime());if(this.timeRemain){this.timeRemain--;}else{this.startInProgressTimer();}},getDisplayTime:function(){var C=this.timeRemain,A=Math.floor(C/(3600)),B,D;C-=(A*3600);B=Math.floor(C/60);C-=(B*60);D=C%60;C=(A)?A+":":"";if(B<1){C+=(A)?"00":"";}else{if(B<10&&A){C+="0"+B;}else{C+=B;}}if(C){C+=":";}if(C&&D<10){D="0"+D.toString();}C+=D;return C;},showLiveStream:function(){$clear(this.timer);(window.universalVideo||document.universalVideo).showClipsFromPage("live","live","live");},setDataAsOptions:function(A){this.setOptions({nodeId:A.Category["@id"],query:A["@id"],broadcastStatus:A.BroadcastStatus.$,broadcastStartTime:A.BroadcastStartTime.$,broadcastEndTime:A.BroadcastEndTime.$,showName:A.FranchiseName.$,promoImg:this.getPromoImage(A)});},findNextLiveStream:function(){if(!this.bound.checkNextLiveStream){this.bound.checkNextLiveStream=this.checkNextLiveStream.bind(this);}this.getLiveStatus(this.bound.checkNextLiveStream);},checkNextLiveStream:function(B){var A=(B[0])&&Math.abs(this.findTimeDifference(B[0].BroadcastStartTime.$))<3600;if(A){this.setDataAsOptions(B[0]);this.initDisplay();}else{this.getArchiveVideo();}},startInProgressTimer:function(){this.showWaitaMinute();this.findStartedLiveStream();},findStartedLiveStream:function(){if(!this.bound.checkForStart){this.bound.checkForStart=this.checkForStart.bind(this);}this.getLiveStatus(this.bound.checkForStart);},checkForStart:function(A){var B=A.filter(function(C){return(C["@id"]==this.options.query);}.bind(this));if(B[0].BroadcastStatus.$=="IN_PROGRESS"){this.options.broadcastStatus="IN_PROGRESS";this.showWatchNowLink();}else{this.timer=this.findStartedLiveStream.delay(30000,this);}},showWatchNowLink:function(){this.timer=$clear(this.timer);if(this.options.page=="show"){this.elems.countdownElem.set("html","<a href=\"javascript:previousLiveClick('live', 'live', 'live');updateEpisodeTitle('"+this.options.liveEpisodeTitle+"');\">Start/restart live stream</a>");}else{this.displayPromo();}this.timer=this.findEndOfLiveStream.delay(this.getEndTimeCheck(),this);},getEndTimeCheck:function(){var A=this.findTimeDifference(this.options.broadcastStartTime),B=this.findTimeDifference(this.options.broadcastEndTime,((A<0)?null:this.options.broadcastStartTime));return(((B<120)?0:B-120)*1000).limit(30000,300000);},findEndOfLiveStream:function(){if(!this.bound.checkForEnd){this.bound.checkForEnd=this.checkForEnd.bind(this);}this.getLiveStatus(this.bound.checkForEnd);},checkForEnd:function(A){var B=A.filter(function(C){return(C["@id"]==this.options.query);}.bind(this));if(!B.length){this.liveStreamIsOver(A);}else{this.findEndOfLiveStream.delay(30000,this);}},showRestartLink:function(){clearInterval(this.timer);this.elems.countdownElem.set("html","<a href=\"javascript:previousLiveClick('live', 'live', 'live');updateEpisodeTitle('"+this.options.liveEpisodeTitle+"');\">Restart live stream</a>");},showWaitaMinute:function(){this.timer=$clear(this.timer);if(["cnetFrontDoor","index"].contains(this.options.page)){var A="/9776-"+this.options.nodeId+"_53-"+this.options.query+".html";this.elems.showStatus.set("html",'<a href="'+A+'" class="upNext">Starts shortly</a>');if(this.elems.cat){this.elems.cat.getElement("div.showStatus").set("text","Starts shortly");}}else{this.elems.countdown.set("html","Live stream will start shortly...");}},displayPromo:function(D){D=D||this.options;var B="/9776-"+D.nodeId+"_53-"+D.query+".html",A=this.elems,E='<div id="pcpWrap">';if(D.nodeId=="31050"){B="/liveatces";}var C=D.franchiseName.toString();D.franchiseName=C.replace(",'","'");E+='<div class="overlay">';E+='<div class="showName"><a href="'+B+'">'+D.franchiseName+"</a></div>";E+='<div class="showStatus"></div>';E+='<div class="watchLink"><a href="'+B+'">Watch</a></div>';E+="</div>";E+='<a href="'+B+'"><img src="'+D.promoImg+'" width="360" height="203" border="0" alt="'+D.franchiseName+'" /></a>';E+="</div>";A.pcPromo.set("html",E);A.showName=A.pcPromo.getElement(".showName");A.showStatus=A.pcPromo.getElement(".showStatus");A.cat=$("cat"+D.nodeId);if(D.broadcastStatus=="UPCOMING"){A.showStatus.set("html",'<a href="'+B+'" class="upNext">Coming up next</a>');A.showStatus.setStyle("position","relative");A.showName.setStyle("padding-top",5);if(A.cat){A.cat.getElement("div.showStatus").set("text","Coming up next");}}else{if(D.broadcastStatus=="IN_PROGRESS"){A.showStatus.set("html",'<a href="'+B+'" class="onAir">On the air now</a>');A.showStatus.setStyle("position","relative");A.showName.setStyle("padding-top",5);if(A.cat){A.cat.getElement("DIV.showStatus").set("text","On the air now");A.cat.addClass("showOnAir");}}else{A.showStatus.set("html","");A.showStatus.setStyle("position","absolute");A.showName.setStyles({"font-size":16,"padding-top":12});}}},findTimeDifference:function(A,B){return Math.round((this.makeUTCtime(A)-this.makeUTCtime(B||this.options.now))/1000);},makeUTCtime:function(B){var C=B.split(" "),A=C[0].split("-"),D=C[1].split(":");return Date.UTC(A[0],A[1]-1,A[2],D[0],D[1],Math.round(D[2]));},liveStreamIsOver:function(A){if(this.options.page=="show"){this.countdownElem.set("html","");}this.checkNextLiveStream(A);},loadOnDemandPlayer:function(){this.options.timer=setInterval(this.checkIfPlayerLoaded.bind(this),1000);},checkIfPlayerLoaded:function(){if($("universalPlayer0")){clearInterval(this.options.timer);previousLiveClick("","nodeId",this.options.nodeId);}},addRequestHandler:function(){var A=LiveStreamStatusCheck.reqs.push(this)-1;this.instanceName=this.options.instanceName||"lssc_"+A;LiveStreamStatusCheck.reqs[this.instanceName]=this;},getLiveStatus:function(A){this.addEvent("onLiveReceipt",A);this.fetchData("videoSearch","receiveLiveStatus",{videoIds:"",iod:"images,broadcast,breadcrumb,lowcache",broadcastStatus:"UPCOMING,IN_PROGRESS",orderBy:"broadcastStartTime",sortAsc:"true"});},receiveLiveStatus:function(A){var B;this.clearScript();if(A&&A.CNETResponse&&A.CNETResponse.Videos){B=$splat(A.CNETResponse.Videos.Video);B=B.filter(function(C){return C["@id"]!="50081665";});this.fireEvent("onLiveReceipt",[B]);this.removeEvents("liveReceipt");}},fetchData:function(B,E,D){var C={viewType:"json",partTag:"cntv",callback:"LiveStreamStatusCheck.reqs."+this.instanceName+"."+E},A="?"+new Hash($merge(C,D||{})).toQueryString(),F=this.options.apiUrl+B+A;this.script=new Element("script",{type:"text/javascript",src:F}).inject(document.head);dbug.log("Script request: %s",F);},clearScript:function(){if($type(this.script)=="element"){this.script.dispose();}this.script=null;},getArchiveVideo:function(){if(!this.recentVideos){this.fetchData("resource/recentVideoByFranchiseId","parseArchiveVideo",{franchiseIds:this.options.franchiseIds.toString(),orderBy:"productionDate",sortDesc:"true"});}else{this.getArchivePromo();}},parseArchiveVideo:function(A){if(A&&A.CNETResponse&&A.CNETResponse.Videos){this.recentVideos=$splat(A.CNETResponse.Videos.Video);this.getArchivePromo();}this.clearScript();},getArchivePromo:function(){var A=this.recentVideos.getRandom(),B={franchiseName:A.FranchiseName.$,nodeId:A.Category["@id"],query:A["@id"],promoImg:this.getPromoImage(A)};this.displayPromo(B);},getPromoImage:function(B){if(this.options.page="cnetFrontDoor"){if(this.options.showImages[B.Category["@id"]]){return this.options.showImages[B.Category["@id"]].imageUrl;}else{return this.options.showImages["31050"].imageUrl;}}var A=B.Images.images.filter(function(C){return C["@width"]=="360";});return A[0].ImageURL.$;}});LiveStreamStatusCheck.reqs=[];function refreshMpu(A){try{dbug.log("Refresh MPU for: "+A);var B=PageVars.data.pageType;window.addEvent("domready",function(){var D=new Request({url:"/9740-1_53-0.html?ncat="+A+"&ptype="+B,onComplete:function(G){try{$("metaMpu").set("html",G);}catch(H){}},method:"get"}).send();var E=$("marquee");if(E!=null){var F=new Request({url:"/9740-1_53-0.html?sp=110&width=300&height=70&ncat="+A+"&ptype="+B,onComplete:function(G){try{E.set("html",G);}catch(H){}},method:"get"}).send();}});}catch(C){}}function thisMovie(B){var A=navigator.appName.indexOf("Microsoft")!=-1;return(A)?window[B]:document[B];}function makeCall(A,B,C){thisMovie("GeckoVideoPlayer1").showClipsFromPage(A,B,C);}function subNavClick(A,B,C,D){trackEvent("NavMenuItem;"+D.getAttribute("rev")+";"+A+";"+pageName());thisMovie("GeckoVideoPlayer1").showClipsFromPage(A,B,C);}function promoClick(A,B,C,D){trackEvent("Slide;"+D.getAttribute("id")+";"+C+";"+escape(A));if(C=="live"){B="live";}if(B!="url"){thisMovie("GeckoVideoPlayer1").showClipsFromPage(A,B,C);}else{document.location=C;}}function previousLiveClick(A,B,C){thisMovie("GeckoVideoPlayer1").showClipsFromPage(A,B,C);}function addHoverClass(F){var A=document.getElementById(F);var D=null;if(A!=null){var B=A.getElementsByTagName("LI");for(i=0;i<B.length;i++){try{if(B[i].childNodes.length>2&&B[i].childNodes[2].tagName=="UL"){var C=B[i].childNodes[0].firstChild.nodeValue;B[i].childNodes[0].onmouseover=function(){if(this.firstChild.nodeValue!=D){trackEvent("NavMenuExpand;"+this.firstChild.nodeValue+";"+pageName());D=this.firstChild.nodeValue;}};B[i].onmouseout=B[i].onclick=function(){this.className="";};B[i].onmouseover=function(){this.className="over";};}else{B[i].firstChild.setAttribute("rev",C);}}catch(E){}}}}function dwTrack(C,B){var A="http://dw.com.com/redir?destUrl="+escape("http://i.i.com.com/cnwk.1d/b.gif?"+Math.floor(Math.random()*1000));A+="&edid="+ctvEdid;A+="&oid="+ctvOid;A+="&onid="+ctvOnid;A+="&siteid="+ctvSid;A+="&ptid="+ctvPtid;A+="&ctype="+B;A+="&cval="+C;var D=new Image;D.src=A;dbug.log("dwTrack: "+C);}function trackEvent(B){B=escape(B);var A="http://dw.com.com/redir?destUrl="+escape("http://i.i.com.com/cnwk.1d/b.gif?"+Math.floor(Math.random()*1000));A+="&edid="+ctvEdid;A+="&oid="+ctvOid;A+="&onid="+ctvOnid;A+="&siteid="+ctvSid;A+="&ptid="+ctvPtid;A+="&ctype=event";A+="&cval="+B;var C=new Image;C.src=A;dbug.log("trackEvent: "+B);}function trackPageImpression(B){B=escape(B);var A="http://dw.com.com/redir?destUrl="+escape("http://i.i.com.com/cnwk.1d/b.gif?"+Math.floor(Math.random()*1000));A+="&edid="+ctvEdid;A+="&oid="+ctvOid;A+="&onid="+ctvOnid;A+="&siteid="+ctvSid;A+="&ptid="+ctvPtid;A+="&ctype=pageImpression";A+="&cval="+B;var C=new Image;C.src=A;}function doVideoSearch(){var A=document.videoSearchForm.vkw.value;if(A!=""){document.getElementById("vidSearch").style.height="338px";document.getElementById("vidSearch").style.width="286px";document.getElementById("vidSearchId").style.height="338px";document.getElementById("vidSearchId").style.width="286px";document.getElementById("mostwatch").style.visibility="hidden";thisMovie("vidSearchId").showSearchClips(A);}}function hideSearchResults(){document.getElementById("vidSearch").style.height="1px";document.getElementById("vidSearch").style.width="1px";document.getElementById("vidSearchId").style.height="1px";document.getElementById("vidSearchId").style.width="1px";document.getElementById("mostwatch").style.visibility="visible";}function pageName(){return"FrontDoor";}function loadNewsHeadlines(E,C){var A="/9741-1_53-"+C+".html?_siteid_=53&_editionid_=3&_tilename_="+E;try{dbug.log("Load "+E+" tile for: "+C);var B=new Request.HTML({url:A,update:$("newsheadlines")}).send();}catch(D){}}function loadTabSwapper(A){dbug.log("Load tabSwapper");var C=$("tabSet");var B=$$(C.childNodes);B.each(function(E,D){dbug.log("index: "+D+" idx: "+A);if(D!=A){E.removeClass("on");}else{E.addClass("on");}});}function GetValue(B){squery=location.search;idx=squery.indexOf(B);var A=null;if(idx!=-1){squery=squery.substr(idx+1+B.length,squery.length);if(squery.length>0){nextParam=squery.indexOf("&");if(nextParam!=-1){A=squery.substr(0,nextParam);}else{A=squery.substr(0,squery.length);}}}return A;}function watchQc(B,C,D){var A=new Array();$$("#thumbScroller ul.active li").each(function(F,E){A.include(F.id.substring(3));});A.erase(D);A.unshift(D);dbug.log("set: "+A);thisMovie("GeckoVideoPlayer1").showClipsFromPage(B,C,A.toString());dwTrack("QCVideoItem;"+quickClicks.getTabName()+";"+D+";","event");}function loadNewsHeadlinesv21(D,B){var A="/9741-1_53-"+B+".html?_siteid_=53&_editionid_=3&_tilename_="+D;try{dbug.log("Load "+D+" tile for: "+B);new Request.HTML({url:A,update:$("newsheadlines")}).send();}catch(C){}}function doVideoSearchBox(A){var B=A;if(B!=""){document.getElementById("vidSearch").style.height="338px";document.getElementById("vidSearch").style.width="286px";document.getElementById("vidSearchId").style.height="338px";document.getElementById("vidSearchId").style.width="286px";thisMovie("vidSearchId").showSearchClips(B);$("vidSearchResults").injectInside($("video_results"));}}var QC={};QC=new Class({Implements:Options,currentTop:0,options:{thumbContainer:"productThumbs",thumbScroller:"thumbScroller",leftArrow:"scrollLeft",rightArrow:"scrollRight"},initialize:function(A){this.setOptions(A);this.container=$(this.options.thumbContainer);this.scroller=$(this.options.thumbScroller);this.scroll=new Fx.Scroll(this.container);$(this.options.rightArrow).addEvent("click",this.scrollRight.bind(this));$(this.options.leftArrow).addEvent("click",this.scrollLeft.bind(this));$(this.options.leftArrow).className="end";$(this.options.rightArrow).className="";if($E("#thumbScroller ul")!=null){$E("#thumbScroller ul").className="set active";}this.viewWidth=this.container.getStyle("width").toInt();this.currentPos=0;this.contentWidth=null;this.displaySegment=1;this.tabName=null;if($E("#thumbScroller ul")!=null){this.subsetVisible=this.viewWidth/$E("#thumbScroller ul li").getStyle("width").toInt();}this.resetContent();this.imageLocker=new Object();},scrollLeft:function(){if($(this.options.leftArrow).className!="end"){this.scroll.start(this.getNewX(-1),false);dwTrack("ScrollArrow;"+this.getTabName()+";left;"+this.displaySegment+";","event");}},scrollRight:function(){if($(this.options.rightArrow).className!="end"){this.scroll.start(this.getNewX(1),false);dwTrack("ScrollArrow;"+this.getTabName()+";right;"+this.displaySegment+";","event");}},showItemsCount:function(){dbug.log("showItemsCount: this.contents: "+this.contents);if(this.contents!=null){var B=((this.displaySegment-1)*this.subsetVisible)+1;var A=B+this.subsetVisible-1;if(A>this.contents.length){A=this.contents.length;B=A-this.subsetVisible;}$("qcCount").set({html:"<b>"+B+" - "+A+"</b> of "+this.contents.length+" "+unescape(this.getTabName())+" videos."});}},getNewX:function(C){var B=this.currentPos+(this.viewWidth*C);var A=this.getEndPosition(C);this.currentPos=((B*C)<A)?B:A;this.displaySegment=this.displaySegment+C;dbug.log("newPos: "+B+" endPos: "+A);if((B*C)<A){this.currentPos=B;$(this.options.leftArrow).className="";$(this.options.rightArrow).className="";}else{this.currentPos=A;if(C==-1){$(this.options.leftArrow).className="end";if(B==A){$(this.options.rightArrow).className="";}}else{if(B==A){$(this.options.leftArrow).className="";}$(this.options.rightArrow).className="end";}}return this.currentPos;},getContentWidth:function(){var A=0;this.contents.each(function(B){A+=B.getStyle("width").toInt();});return A;},getEndPosition:function(A){if(this.contentWidth==null){this.contentWidth=this.getContentWidth();}return(A==1)?this.contentWidth-this.viewWidth:0;},resetContent:function(){dbug.log("resetContent2: "+this.imageLocker);this.currentPos=0;this.displaySegment=1;this.contentWidth=null;this.contents=$$("#thumbScroller .active li");this.popUpDesc=$$("#thumbScroller .active li .description");this.scroll.start(0,false);$(this.options.leftArrow).className="end";$(this.options.rightArrow).className="";var A="";$("qcTabs").getElements("li").each(function(C,B){if(C.className=="on"){A=C.get("text");}});this.tabName=A;dbug.log("Selected tab is: "+this.tabName);this.contents.each(function(C){C.addEvent("mouseover",function(){this.addClass("hover");});C.addEvent("mouseout",function(){this.removeClass("hover");});try{var B=C.getElement(".qcImg");if(B.src.length<1){try{B.src=this.imageLocker[C.id];dbug.log("Load image: "+this.imageLocker[C.id]);}catch(D){dbug.log("No image available");}}}catch(D){}},this);},getTabName:function(){return escape(this.tabName);},addToLocker:function(B){dbug.log("imageLocker. Adding "+B.length+" items.");for(var A=0;A<B.length;A++){this.imageLocker[B[A].name]=B[A].imgSrc;}this.resetContent();}});function swap(A){$("qcTabs").getElements("li").each(function(C,B){if(C.get("text")==A.parentNode.get("text")){C.className="on";$$("#thumbScroller .set")[B].className="set active";dwTrack("QCButton;"+escape(C.get("text")),"event");}else{C.className="";$$("#thumbScroller .set")[B].className="set";}});quickClicks.resetContent();}function renderSvPromo(){var A=$$("#logoBox div.ads_lb_vidSpon").length;var H=5-A;var G=new Array();if(typeof ordered=="undefined"){var F=$A(promoArray);for(i=0;H>i;i++){var I=F.getRandom();G.push(I);F.splice(F.indexOf(I),1);}G.each(function(J){dbug.log("randomPromoItem: "+J.name);});}else{G=promoArray;}if(A>0){var C=A*128;$$("#mcol-l").setStyle("width",C+"px");}else{dbug.log("svCount:"+A);}for(i=0;H>i;i++){var E=new Element("div",{id:"promoUnit"});var B=new Element("a",{href:"#",index:i});B.addEvent("click",function(L){dbug.log("getting promoArray at index: "+L);var K=G[L].name;var M=G[L].type;var N=G[L].value;var J=G[L].memo;dwTrack("MidPromo;"+N+";"+J+";","event");if(M=="url"){window.location.href=N;}else{makeCall(K,M,N);}}.pass(i));var D=new Element("img",{src:G[i].imgPath,alt:G[i].imgAlt,width:"125",height:"125",border:"0"});D.injectInside(B);B.injectInside(E);E.injectAfter($("mcol-l"));}}function doVideoSearch21(){var A=document.videoSearchForm.vkw.value;if(A!=""){document.getElementById("vidSearch").style.height="338px";document.getElementById("vidSearch").style.width="286px";document.getElementById("vidSearchId").style.height="338px";document.getElementById("vidSearchId").style.width="286px";thisMovie("vidSearchId").showSearchClips(A);}}function doVideoSearchHH(A,C){if(A==undefined){A="360";}if(C==undefined){C="346";}var E=document.videoSearchForm;var D=E.query.value.tidy();var F=E.target.selectedIndex;var B=E.target.options[F].value;if(D!=""){if(B=="ctv"){document.getElementById("vidSearch").style.height=C+"px";document.getElementById("vidSearch").style.width=A+"px";E.query.value=D;srb.options.searchUrl="/1770-5_53-0.html?query="+D+"&searchtype=cntvSearch";srb.getSearchResults();}else{E.action=B;E.submit();}}}function updateEpisodeTitle(A){$("episodeTitle").set("html",A);if(A.indexOf("LIVE!")!=-1){document.getElementById("calloutImg").src="http://i.i.com.com/cnwk.1d/i/cnettv/cnetlive/on_air_red_holiday.png";}else{document.getElementById("calloutImg").src="http://i.i.com.com/cnwk.1d/i/cnettv/cnetlive/on_demand_red_holiday.png";}}function addHoverClass(F){var A=document.getElementById(F);var D=null;if(A!=null){var B=A.getElementsByTagName("LI");for(i=0;i<B.length;i++){try{if(B[i].childNodes.length>1&&B[i].childNodes[2].tagName=="UL"){var C=B[i].childNodes[0].firstChild.nodeValue;B[i].childNodes[0].onmouseover=function(){if(this.firstChild.nodeValue!=D){trackEvent("NavMenuExpand;"+this.firstChild.nodeValue+";"+pageName());D=this.firstChild.nodeValue;}};B[i].onmouseout=B[i].onclick=function(){this.className="";};B[i].onmouseover=function(){this.className="over";};}else{B[i].firstChild.setAttribute("rev",C);}}catch(E){}}}}window.addEvent("domready",function(){addHoverClass("mainMenu");});
   }
       
