MVC.Controllers.Analytics=MVC.Controller.create("Analytics",{providerId:"",title:"",partnerValue:"MicrosoftVideos",playerName:"Silverlight",csid:"",source:"",pagegroup:"",pageType:"",guid:"",categories:"",subCategories:"",isEmbed:false,_isOpen:false,_isStarted:false,_is50:false,_isEnd:false,videoOpen:function(){if(this._isOpen){return }this._isOpen=true;this._createUrl({pagename:"open^"+this.get("partnerValue"),channel:"MSNvideo^"+this.get("partnerValue"),prop1:"MSNvideo^"+this.get("partnerValue")+"^"+this.get("playerName"),prop2:"en-us",prop3:"MSNvideo^"+this.get("partnerValue"),prop5:"open^"+this.get("partnerValue")})},dropbeacon:function(){var A=new Image();var B=Math.floor(Math.random()*99999999);A.src="http://beacon.securestudies.com/scripts/beacon.dll?C1=1&CXNID=3000001&CDID=CMG_US&CPID=us&CGID=020000&CBID=CMG_Microsoft&C7="+encodeURIComponent(window.location.href)+"&C8="+encodeURIComponent(document.title)+"&C9=";var C="";if(document.referrer!=null){C=encodeURIComponent(document.referrer)}A.src+=C+"&rn="+B},videoStart:function(){if(this._isStart){return }this._isStart=true;setTimeout(function(){this._createUrl({pagename:this.get("providerId")+"^"+this.get("title"),channel:"MSNvideo^"+this.get("partnerValue"),events:"event3",eVar1:this.get("csid"),prop1:"MSNvideo^"+this.get("partnerValue")+"^"+this.get("playerName"),prop2:"en-us",prop3:"MSNvideo^"+this.get("partnerValue"),prop4:this.get("source"),prop5:"playback:contentstart",prop8:this.get("pagegroup"),prop10:"auto",prop11:this.get("csid"),prop17:this.get("title"),prop32:this.get("guid")});dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","play","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","7")}.scope(this),350);this.dropbeacon()},video50Percent:function(){if(this._is50){return }this._is50=true;this._createUrl({pagename:this.get("providerId")+"^"+this.get("title"),channel:"MSNvideo^"+this.get("partnerValue"),eVar1:this.get("csid"),prop1:"MSNvideo^"+this.get("partnerValue")+"^"+this.get("playerName"),prop2:"en-us",prop3:"MSNvideo^"+this.get("partnerValue"),prop4:this.get("source"),prop5:"playback:content50",prop8:this.get("pagegroup"),prop10:"auto",prop11:this.get("csid"),prop17:this.get("title"),prop32:this.get("guid")})},videoEnd:function(){if(this._isEnd){return }this._isEnd=true;this._createUrl({pagename:this.get("providerId")+"^"+this.get("title"),channel:"MSNvideo^"+this.get("partnerValue"),eVar1:this.get("csid"),prop1:"MSNvideo^"+this.get("partnerValue")+"^"+this.get("playerName"),prop2:"en-us",prop3:"MSNvideo^"+this.get("partnerValue"),prop4:this.get("source"),prop5:"playback:contentend",prop8:this.get("pagegroup"),prop10:"auto",prop11:this.get("csid"),prop17:this.get("title"),prop32:this.get("guid")});dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","complete","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","7")},email:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","email","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},dimLights:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","vdimlights","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},twitter:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","vtwitter","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},facebook:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","vface","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},blogToSpaces:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","vblogthis","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},delicious:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","vdelic","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},digg:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","digg","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},originatingSite:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","sref","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},marcomOriginatingSite:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","oref","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},rating:function(){var A=Sys.$("rating_video_A").children();var C=0;for(var B=0;B<A.length;B++){if(A[B].className=="ratedRatingStar"){C++}}dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","rate","DCSext.vp_rating",C,"WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},embed:function(){dcsMultiTrack("DCSext.vp_video",this.get("title"),"DCSext.vp_evt","embed","WT.cg_n",this.get("categories"),"WT.cg_s",this.get("subCategories"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},_createUrl:function(B){if(typeof (s)!="undefined"){for(var C in B){s[C]=B[C]}var A=s.t()}},silverlightInstall:function(){dcsMultiTrack("DCSext.vp_sli",this.get("pageType"),"DCSext.vp_site",this.get("pageType"),"WT.dl","1")},actions:{Init:function(A){A=A||{};this.set("providerId",A.providerId);this.set("title",A.title);this.set("csid",A.csid);this.set("source",A.source);this.set("pagegroup",A.pagegroup);this.set("guid",A.guid);this.set("categories",A.categories);this.set("subCategories",A.subCategories);this.set("isEmbed",A.isEmbed!=undefined?A.isEmbed:false);this.set("pageType",this.get("isEmbed")==true?"Embedded":"Portal")}}});
MVC.View.create("Embed",{controllerName:"VideoPlayer",init:function(Q,V){this.player=Q;var K=Q.startPlayer,E=MSVideo.ControlAddOnResources.Main.Icons,I=K._downloader,L=K.getHost(),T=K._theme,H=K.findName("controlAddOn"),U;H.Visibility="Visible";var S=this.player.startPlayer.findName("watermark");S.AddEventListener("MouseEnter",this.routeEvent("HideControls"));S.AddEventListener("MouseLeave",this.routeEvent("ShowControls"));S.AddEventListener("MouseLeftButtonDown",function(X){this.getController().redirectToSite("/video/en/us/default.aspx","timeoutNo")}.scope(this));K.findName("chromeBorder").Visibility="Visible";for(var O=0,W=5,P=E.length;O<P;O++,W+=80){if(E[O].xname=="Share"){W-=13}if(E[O].xname=="Info"){W-=5}var C=['<Canvas Canvas.Left="'+W+'" ','Canvas.Top="10" Canvas.ZIndex="2" Name="',E[O].xname+'"/>'];var B=L.createFromXaml(C.join(""));var J='<Image Canvas.Left="0" Canvas.Top="0" Canvas.ZIndex="1"/>';var R=L.createFromXaml(J);R.SetSource(I,E[O].Source);U=B.Name+"Text";var A=20;if(B.Name=="Embed"){A=25}if(B.Name=="Info"){A=22}var D=['<TextBlock Text="'+E[O].Text+'" ','Canvas.Left="'+A+'" Canvas.Top="3" Canvas.ZIndex="1" TextWrapping="Wrap" ','Name = "'+U+'" Foreground="White" ','FontFamily="Arial" FontSize="11" />'];var M=L.createFromXaml(D.join(""));B.children.add(R);B.children.add(M);H.children.add(B);B.AddEventListener("MouseLeftButtonDown",this.routeEvent("EmbeddedMenuClick"));B.AddEventListener("MouseEnter",this.routeEvent("ShowMenuTextHighlight"));B.AddEventListener("MouseLeave",this.routeEvent("HideMenuTextHighlight"))}var G=L.findName("closeSign");G.AddEventListener("MouseLeftButtonDown",this.routeEvent("HideEmbedScreens"));this.player.renderTooltips(MSVideo.ControlAddOnResources.Tooltip.Embed);Sys.$("share_links_blogToSpaces").on("mousedown",this.routeEvent("ShareClick"));Sys.$("share_links_digg").on("mousedown",this.routeEvent("ShareClick"));Sys.$("share_links_delicious").on("mousedown",this.routeEvent("ShareClick"));Sys.$("share_links_facebook").on("mousedown",this.routeEvent("ShareClick"));Sys.$("share_links_twitter").on("mousedown",this.routeEvent("ShareClick"));Sys.$("origSiteImg").on("mousedown",this.routeEvent("originatingSiteClicked"));Sys.$("origSiteLink").on("mousedown",this.routeEvent("originatingSiteClicked"));Sys.$("embeddedTabs").on("mouseover",this.routeEvent("ShowControls")).on("mouseout",this.routeEvent("HideControls"));var F=Sys.$("email_form");F.on("submit",this.routeEvent("EmailSubmit",{url:F.getAttribute("action"),method:F.getAttribute("method")}));var N=this.player.startPlayer.findName("rootVideoCanvasTransform");N.ScaleX=0.93;N.ScaleY=0.93},helpers:{showMain:function(){Sys.$("embeddedTabs").show();this.player.startPlayer.findName("relatedContent").Visibility="Collapsed"},showEmail:function(){Sys.$("video_email_view").addClass("on");document.getElementById("email_form").style.display="block"},hideEmail:function(){Sys.$("video_email_view").removeClass("on")},showInfo:function(){Sys.$("video_info_view").addClass("on");document.getElementById("origSiteImg").style.marginLeft="-8px"},hideInfo:function(){Sys.$("video_info_view").removeClass("on")},showEmbed:function(){Sys.$("video_embed_view").addClass("on");var A=$get("embed_html");A.select();A.focus()},hideEmbed:function(){Sys.$("video_embed_view").removeClass("on")},showShare:function(){Sys.$("video_share_view").addClass("on");var A=$get("video_linkField");A.select();A.focus()},hideShare:function(){Sys.$("video_share_view").removeClass("on")},resizeVideo:function(){var L=this.player.startPlayer;var E=L.findName("marcom");E.Visibility="Collapsed";var C=L.findName("VideoWindow");C["Canvas.Left"]=0;C["Canvas.Top"]=46;C.Width="211";C.Height="160";var I=L.findName("VideoScreensTransform");var A=L.findName("VideoScreens");A["Canvas.Top"]=36;I.ScaleX=0.5;I.ScaleY=0.5;this.ShrinkedVideoToken=C.AddEventListener("MouseLeftButtonDown",this.routeEvent("HideEmbedScreens"));var J=L.findName("closeSign");J.Visibility="Visible";var G=L.findName("iconPopup");G.Visibility="Visible";var B=L.findName("loadingImageScale");B.ScaleX=211/430;B.ScaleY=160/326;B.CenterX=0;B.CenterY=(36+160)/2;var K=L.findName("PlaceholderImage_Container");if(K.Visibility=="Visible"){var F=K.Children;var M;K["Canvas.Left"]=0;K["Canvas.Top"]=46;K.Width="211";K.Height="160";for(var D=0,H=F.Count;D<H;D++){M=F.GetItem(D);M["Canvas.Left"]=0;M["Canvas.Top"]=0;M.Width="211";M.Height="160"}}},hideScreens:function(){var L=this.player.startPlayer;var C=L.findName("VideoWindow");C["Canvas.Left"]=0;C["Canvas.Top"]=0;C.Width="430";C.Height="326";var E=L.findName("marcom");if(E.Opacity!=0){E.Visibility="Visible"}var I=L.findName("VideoScreensTransform");var A=L.findName("VideoScreens");A["Canvas.Top"]=0;I.ScaleX=1;I.ScaleY=1;C.RemoveEventListener("MouseLeftButtonDown",this.ShrinkedVideoToken);var K=L.findName("PlaceholderImage_Container");if(K.Visibility=="Visible"){var F=K.Children;var M;K["Canvas.Left"]=0;K["Canvas.Top"]=0;K.Width="430";K.Height="326";for(var D=0,H=F.Count;D<H;D++){M=F.GetItem(D);M["Canvas.Left"]=0;M["Canvas.Top"]=0;M.Width="430";M.Height="326"}}var J=L.findName("closeSign");J.Visibility="Collapsed";var G=L.findName("iconPopup");G.Visibility="Collapsed";var B=L.findName("loadingImageScale");B.ScaleX=1;B.ScaleY=1;B.CenterX=0;B.CenterY=0;Sys.$("embeddedTabs").hide();this.player.startPlayer.findName("relatedContent").Visibility="Visible"}}});
Sys.$(window).on("load",function(){var C=MVC.config;var H=MVC.config.controllers;var A=MVC.Controller.setup;var B={Analytics:MVC.Controller.getController("Analytics"),VideoPlayer:MVC.Controller.getController("VideoPlayer")};var F=new MVC.Models.VideoInfo(MVC.config.controllers.VideoPlayer.models.videoData.json);var E=new MVC.Models.VideoInfoCollection(MVC.config.data.videoInfo);var D=B.VideoPlayer;var G=B.Analytics;H.Analytics=H.Analytics||{};MVC.mix(H.Analytics,{parentId:H.VideoPlayer.views.VideoPlayer.playerConfig.parentId,title:F.getTitle(),guid:F.getId(),providerId:F.getProviderId(),csid:F.getCsid(),source:F.getSource(),pagegroup:F.getPageGroup(),categories:MVC.config.data.categories,subCategories:MVC.config.data.subCategories,isEmbed:true});D.get("models").Videos=E;D.observe("opened",G.videoOpen,G);D.observe("played",G.videoStart,G);D.observe("fiftyPercent",G.video50Percent,G);D.observe("details",function(I){switch(I){case"Embed":G.embed();break}});D.observe("endScreen",G.videoEnd,G);D.observe("marcomOriginatingSiteClick",G.marcomOriginatingSite,G);D.observe("originatingSiteClick",G.originatingSite,G);D.observe("embedEmailClick",G.email,G);D.observe("diggLinkClick",G.digg,G);D.observe("deliciousLinkClick",G.delicious,G);D.observe("blogToSpacesLinkClick",G.blogToSpaces,G);D.observe("facebookLinkClick",G.facebook,G);D.observe("twitterLinkClick",G.twitter,G);A(B,H)});