
/* start ~/Content/scripts/freebies.js*/
var FreebieInstaller={};FreebieInstaller.Errors={RequestFailed:"The content installation failed.  Please try again.",UserCanceled:"",Unknown:"There was a problem installing the requested themepack.\n\nPlease make sure that you are signed into Windows Live Messenger,\nthen refresh this web page, and try downloading the themepack again.",Login:"Please sign into MSN Messenger and try again",Content:"We could not find the requested themepack.  Please try again later.",Busy:"Please wait until the first download process is completed, then try again.",Success:"The theme has been installed and is ready to use in Messenger."};FreebieInstaller.errStatus=0;FreebieInstaller.expandPath=function(a){return a.indexOf("http")==0?a:window.location.protocol+"//"+window.location.host+a};FreebieInstaller.installError=function(a){alert(a);FreebieInstaller.errStatus=1};FreebieInstaller.installSuccess=function(a){alert(a)};FreebieInstaller.downloadContent=function(a){window.open(FreebieInstaller.expandPath(a))};FreebieInstaller.installSpacesTheme=function(a){window.open(a)};FreebieInstaller.installMessengerContent=function(b){var c=FreebieInstaller.expandPath(b);if($.browser.msie){try{MessengerContentInstaller.InstallContent(c)}catch(a){FreebieInstaller.onMessengerContentInstalled(a.number)}}else{FreebieInstaller.downloadContent(c)}};FreebieInstaller.onMessengerContentInstalled=function(a){var b=a&65535;var c=(a>>16)&65535;switch(b){case 876:FreebieInstaller.installError(FreebieInstaller.Errors.RequestFailed);break;case 907:FreebieInstaller.installError(FreebieInstaller.Errors.UserCanceled);break;case 16389:FreebieInstaller.installError(FreebieInstaller.Errors.Unknown);break;case 65535:FreebieInstaller.installError(FreebieInstaller.Errors.Unknown);break;case 798:FreebieInstaller.installError(FreebieInstaller.Errors.Login);break;case 87:FreebieInstaller.installError(FreebieInstaller.Errors.Content);break;case 5:FreebieInstaller.installError(FreebieInstaller.Errors.Busy);break;default:if(b==0&&c==0){FreebieInstaller.installSuccess("Install completed successfully")}else{FreebieInstaller.installError(FreebieInstaller.Errors.Unknown)}break}};var freebiesSetup=false;WL.registerOnloadEvent(function(){if(!freebiesSetup){var b=function(e,g,f){var c=$(e),d=c.find("a.cta");g.preventDefault();g.stopPropagation();f(d.attr("href"))};var a=function(e,c){var d=$(e);d.each(function(f){var h=d.get(f),g=$(h),j=g.find("a.cta");g.click(function(i){WL.eventHandler.trigger("scFreebie",j);b(h,i,c)});j.click(function(i){i.preventDefault()})})};a(".SpacesThemePack",FreebieInstaller.installSpacesTheme,"scFreebie");if($.browser.msie){a(".MessengerWink, .MessengerThemePack, .MessengerBackground, .MessengerEmoticons",FreebieInstaller.installMessengerContent)}else{$(".MessengerWink, .MessengerBackground, .MessengerThemePack, .MessengerEmoticons").css("cursor","default")}a(".DesktopScreensaver",FreebieInstaller.downloadContent);$(".HotmailSignature").each(function(){var d=$(this),c=d.find(".cta");Modal.Setup(d,c.attr("href")).SuppressTrackView=true;d.click(function(f){WL.eventHandler.trigger("scFreebie",c)})});$(".MessengerSounds").each(function(){var d=$(this),c=d.find(".cta");Modal.Setup(d,c.attr("href"),{ClassName:"SoundsModal",SuppressTrackView:true});d.click(function(f){WL.eventHandler.trigger("scFreebie",c)})});freebiesSetup=true}});
/* end ~/Content/scripts/freebies.js */