// Copyright (c) Microsoft Corporation. All rights reserved.
if(!window.Microsoft){window.Microsoft={__namespace:true};}
if(!window.Microsoft.Live){window.Microsoft.Live={__namespace:true};}
if(!window.Microsoft.Live.Core){window.Microsoft.Live.Core={__namespace:true};}
Microsoft.Live.Core.Loader=function(){this._detectBrowsers();this._addDocumentReadyListener();this._resolveMarket();this._resolveDirection();this._detectSecureConnection();}
Microsoft.Live.Core.Loader.prototype={_loadInitiated:false,_paused:false,_loadRequests:[],_readyRequests:[],_domRequests:[],_documentReady:false,_browser:{},_iframeResources:[],_secureConnection:false,_settingRegEx:/(\{[^\}^\{]+\})/g,_startTime:(new Date()).getTime(),_loadTime:null,_settings:{direction:"ltr",configuration:"retail",market:null,resourceMarket:null},_supportedMarkets:["ar","ar-sa-psloc","bg","ca","cs","da","de","de-de-psloc","el","en","es","et","eu","fi","fr","gu","he","hi","hr","hu","id","it","ja","ja-jp-psloc","kn","ko","lt","lv","ml","mr","ms","nb-no","nl","pl","pt-br","pt-pt","ro","ru","sk","sl","sr","sr-cyrl-cs","sv","ta","te","th","tr","uk","vi","zh-cn","zh-hk","zh-tw"],_resources:{"microsoft_ajax_core":{filename:"{messenger.baseScriptUrl}/microsoftajaxcore.js",type:"script",objectType:"Sys",dependencies:[]},"microsoft_ajax_extensions":{filename:"{messenger.baseScriptUrl}/mscorlib.js",type:"script",dependencies:["microsoft_ajax_core"]},"microsoft_ajax_globalization":{filename:"{messenger.baseScriptUrl}/microsoftajaxglobalization.js",type:"script",dependencies:["microsoft_ajax_core"]},"json_parser":{filename:"{messenger.baseScriptUrl}/json2.js",type:"script",objectType:"JSON",dependencies:[]},"scriptsharp_compat":{filename:"{messenger.baseScriptUrl}/sscompat.js",type:"script",browsers:function(b){return b["opera"]||b["webkit"]||b["firefox"];},objectType:"ScriptLoader",dependencies:["microsoft_ajax_globalization"]},"scriptsharp":{filename:"{messenger.baseScriptUrl}/sscorlib.js",type:"script",objectType:"ScriptLoader",dependencies:["scriptsharp_compat"]}},addScript:function(scriptName,url,dependencies){this._addFeature(scriptName,"script",url,dependencies);},addStyleSheet:function(styleSheetName,url,dependencies){this._addFeature(styleSheetName,"stylesheet",url,dependencies);},get_settings:function(){return this._settings;},get_documentReady:function(){return this._documentReady;},set_documentReady:function(value){if(value){this._onDocumentReady();}},get_scriptsLoadTime:function(){return this._loadTime;},getIframeContainer:function(resourceId){var resource=this._resources[resourceId];if(resource&&resource.containerId){for(var index=this._iframeResources.length-1;index>=0;index--){if(this._iframeResources[index].containerId==resource.containerId){return this._iframeResources[index].frameContainer;}}} return null;},initialize:function(settings){if(!settings){return;} if(this._loadInitiated){throw new Error("Cannot invoke initialize() after load() has been invoked");} if(settings.environment&&settings.environment!="production"){for(var setting in this._settings){var settingItem=this._settings[setting];if(!settingItem){continue;} var environmentSettings=settingItem[settings.environment];if(environmentSettings){for(var envSetting in environmentSettings){settingItem[envSetting]=environmentSettings[envSetting];} break;}}} for(var newSetting in settings){if(newSetting=="environment"){continue;} var subkeys=newSetting.split('.');var qualifier=subkeys.pop();var subSetting=this._getSubSetting(subkeys);if(!subSetting||typeof(subSetting[qualifier])=="undefined"){throw new Error("Invalid setting: "+newSetting);} if(newSetting=="market"){this._tryUpdateMarket(settings[newSetting]);} else{subSetting[qualifier]=settings[newSetting];}} for(var setting in this._settings){if(this._settings[setting].updateSettings){this._settings[setting].updateSettings(this._settings,this._resources,settings);}}},load:function(features,callback){if(!features||features.length<=0){throw new Error("No features provided");} var resources=[];for(var i=0;i<features.length;i++){if(features[i].indexOf('_')>=0){throw new Error("Feature '%1' does not exist".replace("%1",features[i]));} var resource=this._normalizeName(features[i]);if(!this._resources[resource]){throw new Error("Feature '%1' does not exist".replace("%1",resource));} if(this._resources[resource].httpOnly&&this._secureConnection){throw new Error("Feature '%1' is not supported in an HTTPS environment".replace("%1",resource));} resources.push(resource);} this._loadInitiated=true;this._loadRequests.push({"resources":resources,"callback":callback});this._process();},onReady:function(callback){if(!callback){throw new Error("No callback provided");} if(this._loadRequests.length==0){this._invokeCallback(callback);return;} this._readyRequests.push({"callback":callback});},onDocumentReady:function(callback){if(!callback){throw new Error("No callback provided");} if(this._documentReady){this._invokeCallback(callback);return;} this._domRequests.push({"callback":callback});},pause:function(){this._paused=true;},resume:function(){this._paused=false;this._process();},onResourceAvailable:function(resourceName,callback){var resource=this._resources[resourceName];if(!resource||!callback){return;} resource.onAvailableCallback=callback;},_addFeature:function(featureName,featureType,url,dependencies){if(!featureName||featureName.length==0){throw new Error("featureName must not be empty");} if(featureName.indexOf('_')>=0){throw new Error("featureName cannot contain '_'");} if(!url||url.length==0){throw new Error("fileName must not be empty");} featureName=this._normalizeName(featureName);if(this._resources[featureName]){throw new Error("Feature already exists");} var normalized=[];if(dependencies){if(!this._isArray(dependencies)){throw new Error("dependencies must be an array of strings");} for(var i=0;i<dependencies.length;i++){normalized.push(this._normalizeName(dependencies[i]));}} this._resources[featureName]={"url":url,"type":featureType,"dependencies":normalized};},_addManifest:function(manifestName,resources,settings){if(resources){for(var resource in resources){if(this._resources[resource]){throw new Error("Resource '%1' already exists".replace("%1",resource));} this._resources[resource]=resources[resource];}} if(settings){this._settings[manifestName]=settings;if(settings.updateSettings){settings.updateSettings(this._settings,this._resources,null);}}},_normalizeName:function(name){return name.toLowerCase().replace(/\./g,"_");},_process:function(){if(this._paused){return;} var callbacks=[];for(var i=0;i<this._loadRequests.length;i++){var loadRequest=this._loadRequests[i];var pendingCount=0;for(var j=0;j<loadRequest.resources.length;j++){pendingCount+=this._loadResources(this._resources[loadRequest.resources[j]]);} if((pendingCount==0)&&(!this._loadTime)){this._loadTime=(new Date()).getTime()-this._startTime;} if((pendingCount==0)&&this._documentReady){if(loadRequest.callback){callbacks.push(loadRequest.callback);} this._loadRequests.splice(i--,1);}} if(this._loadRequests.length==0){while(this._readyRequests.length>0){var readyRequest=this._readyRequests.shift();callbacks.push(readyRequest.callback);}} while(callbacks.length>0){var callback=callbacks.shift();this._invokeCallback(callback);}},_loadResources:function(resource){var pendingCount=0;switch(resource.loaderReadyState){case"loaded":break;case"loading":pendingCount=1;if(resource.async){pendingCount+=this._loadResourceDependencies(resource);} break;case"available":pendingCount=this._loadResourceDependencies(resource);if(pendingCount==0){if(resource.onAvailableCallback&&!resource.onAvailableCallbackCalled){resource.onAvailableCallbackCalled=true;resource.onAvailableCallback.call();} resource.loaderReadyState="loaded";} else{pendingCount++;} break;default:pendingCount=this._loadResourceDependencies(resource);if(pendingCount==0||resource.async){this._loadResource(resource);pendingCount++;} break;} return pendingCount;},_loadResourceDependencies:function(resource){var pendingCount=0;for(var i=0;i<resource.dependencies.length;i++){pendingCount+=this._loadResources(this._resources[resource.dependencies[i]]);} return pendingCount;},_loadResource:function(resource){if(resource.loaderReadyState=="loading"){return;} resource.loaderReadyState="loading";if(!resource.filename&&!resource.url){this._onResourceLoaded(resource);return;} if(!this._browserRequires(resource)){this._onResourceLoaded(resource);return;} switch(resource.type){case"script":this._loadScript(resource);break;case"stylesheet":this._loadStyleSheet(resource);break;case"channeliframe":this._loadChannelIFrame(resource);break;}},_browserRequires:function(resource){if(resource.browsers){return resource.browsers(this._browser);} return true;},_loadScript:function(resource){if(resource.objectType){if(window[resource.objectType]!==undefined){this._onResourceLoaded(resource);return;}} var loader=this;var element=document.createElement("SCRIPT");if(this._browser.ie){element.attachEvent("onreadystatechange",function(){loader._onScriptLoad(window.event,resource);});} else{element.readyState="complete";element.addEventListener("load",function(e){loader._onScriptLoad(e,resource);},false);} element.type="text/javascript";element.src=this._getUrl(resource);document.getElementsByTagName("HEAD")[0].appendChild(element);},_loadChannelIFrame:function(resource){if(!resource.containerId||!resource.filename){this._onResourceLoaded(resource);return;} var url=this._getUrl(resource);var frameContainer=document.getElementById(resource.containerId);if(!frameContainer){var controlElement=document.createElement('div');controlElement.id=resource.containerId;controlElement.style.height='1pt';controlElement.style.width='1pt';controlElement.style.position='absolute';controlElement.style.top='-100px';frameContainer=controlElement;} var iframe=document.createElement('iframe');iframe.frameBorder='0';iframe.style.width='100%';iframe.style.height='100%';iframe.src=url;iframe.id=resource.frameId;frameContainer.appendChild(iframe);resource.frameContainer=frameContainer;this._iframeResources.push(resource);if(this._documentReady){this._appendIFrameResourcesToBody();} this._onResourceLoaded(resource);},_loadStyleSheet:function(resource){var element=document.createElement("LINK");element.type="text/css";element.rel="stylesheet";element.media="screen";element.href=this._getUrl(resource);document.getElementsByTagName("HEAD")[0].appendChild(element);this._onResourceLoaded(resource);},_lookupSettings:function(resource,setting){var key=setting.substring(1,setting.length-1);var subkeys=key.split('.');if(subkeys[0]=="resource"){return setting;} var qualifier=subkeys.pop();var subSetting=this._getSubSetting(subkeys);if(subSetting){var settingVal=subSetting[qualifier];if(this._isArray(settingVal)){return this._hashSelect(settingVal,resource)} if(settingVal||typeof(settingVal)=='boolean'||typeof(settingVal)=='number'){return subSetting[qualifier];}} return"";},_isArray:function(value){return(value)&&(Object.prototype.toString.apply(value)==='[object Array]');},_hashSelect:function(list,resource){var artifactName=resource.filename||resource.url;var lastIndex=artifactName.lastIndexOf('/');if(lastIndex<0){lastIndex=0;} else{lastIndex++;} var hash=this._computeFastHash(artifactName.substring(lastIndex));return list[hash%list.length];},_computeFastHash:function(str){if(!str||!str.length){return 0;} var hash=5381;for(var i=0,len=str.length;i<len;i++){hash=((hash<<5)+hash)+str.charCodeAt(i);} if(hash<0){hash*=-1;} return hash;},_getSubSetting:function(subkeys){var setting=this._settings;if(!subkeys.length){return setting;} for(var i=0;i<subkeys.length;i++){setting=setting[subkeys[i]];if(!setting){return null;}} return setting;},_getUrl:function(resource){if(resource.url){return resource.url;} var url=resource.filename;var l=this;url=url.replace(this._settingRegEx,function(setting){return l._lookupSettings(resource,setting);});url=url.replace(this._settingRegEx,function(setting){return l._lookupSettings(resource,setting);});return url;},_onScriptLoad:function(e,resource){if(resource.loaderReadyState=="loaded"){return;} var element=e.srcElement||e.currentTarget;if(!element.readyState){element=e.currentTarget;} if((element.readyState!="complete")&&(element.readyState!="loaded")){return;} if(resource.async){this._onResourceAvailable(resource);} else{this._onResourceLoaded(resource);}},_onResourceLoaded:function(resource){resource.loaderReadyState="loaded";this._process();},_onResourceAvailable:function(resource){resource.loaderReadyState="available";this._process();},_normalizeMarket:function(market){market=market||"";market=market.toLowerCase();if(this._getResourceMarket(market)){return market;} return null;},_getResourceMarket:function(market){if(this._supportsMarket(market)){return market;} var idx=market.lastIndexOf("-");if(idx<0){return null;} market=market.substr(0,idx);if(this._supportsMarket(market)){return market;} return null;},_supportsMarket:function(market){var low=0;var high=this._supportedMarkets.length-1;while(low<=high){var i=Math.floor((low+high)/2);var curr=this._supportedMarkets[i];if(curr<market){low=i+1;continue;} if(curr>market){high=i-1;continue;} return true;} return false;},_resolveDirection:function(){var direction="ltr";var elements=document.getElementsByTagName("html");if(elements&&elements.length>0){direction=elements[0].getAttribute("dir")||"";} direction=direction.toLowerCase();switch(direction){case"ltr":case"rtl":this._settings.direction=direction;break;}},_resolveMarket:function(settings){var market="";if(settings){if(this._tryUpdateMarket(settings.market)){return;}} if(this._settings.market){return;} var elements=document.getElementsByTagName("html");var element=(elements&&elements.length>0)?elements[0]:null;if(element){market=element.getAttribute("xml:lang")||"";} if(this._tryUpdateMarket(market)){return;} if(element){market=element.getAttribute("lang")||"";} if(this._tryUpdateMarket(market)){return;} this._tryUpdateMarket("en-us");},_tryUpdateMarket:function(market){market=this._normalizeMarket(market);if(market){this._settings.market=market;this._settings.resourceMarket=this._getResourceMarket(market);return true;} return false;},_detectBrowsers:function(){var ua=navigator.userAgent.toLowerCase();this._browser={"firefox":/firefox/.test(ua),"firefox1.5":/firefox\/1\.5/.test(ua),"firefox2":/firefox\/2/.test(ua),"firefox3":/firefox\/3/.test(ua),"ie":/msie/.test(ua)&&!/opera/.test(ua),"ie6":/msie 6/.test(ua)&&!/opera/.test(ua),"ie7":/msie 7/.test(ua)&&!/opera/.test(ua),"ie8":/trident\/4/.test(ua)&&(document.documentMode==8)&&!/opera/.test(ua),"ie8compat":/trident\/4/.test(ua)&&(document.documentMode<=7)&&!/opera/.test(ua),"opera":/opera/.test(ua),"webkit":/webkit/.test(ua)};},_detectSecureConnection:function(){this._secureConnection=document.location.protocol.toLowerCase()=="https:";},_addDocumentReadyListener:function(){var loader=this;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){loader._onDocumentReady();},false);document.addEventListener("load",function(){loader._onDocumentReady();},false);} else if(window.attachEvent){window.attachEvent("onload",function(){loader._onDocumentReady();});} if(this._browser.ie){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);loader._onDocumentReady();}});}},_invokeCallback:function(callback){window.setTimeout(callback,1);},_onDocumentReady:function(){if(this._documentReady==false){this._documentReady=true;var callbacks=[];this._appendIFrameResourcesToBody();while(this._domRequests.length>0){var domRequest=this._domRequests.shift();callbacks.push(domRequest.callback);} while(callbacks.length>0){var callback=callbacks.shift();this._invokeCallback(callback);} this._process();}},_appendIFrameResourcesToBody:function(){for(var index=this._iframeResources.length-1;index>=0;index--){if(!this._iframeResources[index].hasParent){this._iframeResources[index].hasParent=true;document.body.appendChild(this._iframeResources[index].frameContainer);}}}}
Microsoft.Live.Core.Loader=new Microsoft.Live.Core.Loader();Microsoft.Live.Core.Loader._addManifest("messenger",{"mesh":{async:true,filename:"{messenger.baseScriptUrl}/Microsoft.Live.Mesh.Framework.js",type:"script",dependencies:["microsoft_ajax_extensions"]},"messenger_channel":{filename:"{messenger.baseScriptUrl}/channel.js",type:"script",objectType:"postMessage",dependencies:[]},"messenger_iframe":{type:"channeliframe",dependencies:[],containerId:"MsgrContainer1",frameId:"ifm"+Math.floor(Math.random()*1024*1024),filename:"{messenger.applicationPath}/{messenger.version}/Messenger.html?domain={messenger.documentDomain}"+"&env={messenger.environmentOverride}"+"&signInServer={messenger.serviceHostNameOverride}"+"&scriptPath={messenger.scriptPathOverride}"+"&signInState={messenger.signInState}"+"&localStorageDisabled={messenger.localStorageDisabled}"+"&{messenger.channelTypeQualifier}"},"messenger_common":{async:true,filename:"{messenger.baseScriptUrl}/Microsoft.Live.Messenger.Common.js",type:"script",dependencies:["microsoft_ajax_extensions","json_parser"]},"messenger_core":{async:true,filename:"{messenger.baseScriptUrl}/Microsoft.Live.Messenger.Model.js",type:"script",dependencies:["messenger_common","messenger_services_loader","messenger_services_core","messenger_iframe","messenger_channel"]},"messenger_ui_primitives":{async:true,filename:"{messenger.resourcePath}/{messenger.version}/{resourceMarket}/{configuration}/Microsoft.Live.Messenger.UI.Primitives.js",type:"script",dependencies:["mesh"]},"messenger_ui_controls":{async:true,filename:"{messenger.resourcePath}/{messenger.version}/{resourceMarket}/{configuration}/Microsoft.Live.Messenger.UI.Controls.js",type:"script",dependencies:["microsoft_ajax_globalization","mesh","messenger_ui_primitives","messenger_core"]},"messenger_ui":{async:true,filename:"{messenger.baseScriptUrl}/Microsoft.Live.Messenger.UI.Tags.js",type:"script",dependencies:["messenger_ui_controls"]},"messenger_services_loader":{async:true,filename:"{messenger.baseScriptUrl}/Microsoft.Live.Messenger.Services.Loader.js",type:"script",dependencies:[]},"messenger_services_core":{async:true,filename:"{messenger.baseScriptUrl}/Microsoft.Live.Messenger.Services.Core.js",type:"script",dependencies:[]},"messenger_ui_styles_core":{type:"stylesheet",dependencies:["messenger_ui_styles_core_ie6","messenger_ui_styles_core_ie7","messenger_ui_styles_core_ie8","messenger_ui_styles_core_webkit","messenger_ui_styles_core_other"]},"messenger_ui_styles_core_ie6":{filename:"{messenger.baseStyleSheetUrl}/core.ie6.{messenger.localizedMarket}.css",type:"stylesheet",browsers:function(b){return b["ie6"];},dependencies:[]},"messenger_ui_styles_core_ie7":{filename:"{messenger.baseStyleSheetUrl}/core.ie7.{messenger.localizedMarket}.css",type:"stylesheet",browsers:function(b){return b["ie7"]||b["ie8compat"];},dependencies:[]},"messenger_ui_styles_core_ie8":{filename:"{messenger.baseStyleSheetUrl}/core.ie8.{messenger.localizedMarket}.css",type:"stylesheet",browsers:function(b){return b["ie8"];},dependencies:[]},"messenger_ui_styles_core_webkit":{filename:"{messenger.baseStyleSheetUrl}/core.webkit.{messenger.localizedMarket}.css",type:"stylesheet",browsers:function(b){return b["webkit"];},dependencies:[]},"messenger_ui_styles_core_other":{filename:"{messenger.baseStyleSheetUrl}/core.other.{messenger.localizedMarket}.css",type:"stylesheet",browsers:function(b){return!b["ie"]&&!b["webkit"];},dependencies:[]}},{"version":"3.50.46010","localizedMarket":"other","resourcePath":"http://www.wlmessenger.net/api","imageResourcePath":"http://www.wlmessenger.net/api","styleResourcePath":"http://css.wlmessenger.net/api","audioResourcePath":"http://css.wlmessenger.net/api","applicationPath":"http://settings.messenger.live.com/api","applicationHostName":"settings.messenger.live.com","consentHostName":"consent.messenger.services.live.com","baseScriptUrl":"{messenger.resourcePath}/{messenger.version}/{configuration}","baseStyleSheetUrl":"{messenger.styleResourcePath}/{messenger.version}/resources/styles/{direction}","channelTypeQualifier":"","serviceHostName":"","localStorageDisabled":false,"disableFlash":false,"testReportingEnabled":false,"channelPortValidationDisabled":false,"int":{"resourcePath":"http://settings.messenger.live-int.com/api","imageResourcePath":"http://settings.messenger.live-int.com/api","styleResourcePath":"http://settings.messenger.live-int.com/api","audioResourcePath":"http://settings.messenger.live-int.com/api","applicationPath":"http://settings.messenger.live-int.com/api","consentHostName":"int-consent.messenger.services.live-int.com","serviceHostName":"applications.messenger.live-int.com","applicationHostName":"settings.messenger.live-int.com"},"f1":{"resourcePath":"http://tk1msg1160908.gateway.edge.messenger.live-int.com/api","imageResourcePath":"http://tk1msg1160908.gateway.edge.messenger.live-int.com/api","styleResourcePath":"http://tk1msg1160908.gateway.edge.messenger.live-int.com/api","audioResourcePath":"http://tk1msg1160908.gateway.edge.messenger.live-int.com/api","applicationPath":"http://tk1msg1160908.gateway.edge.messenger.live-int.com/api","consentHostName":"corep5-consent.messenger.services.live-int.com","serviceHostName":"tk1msg1160914.edge.messenger.live-int.com","applicationHostName":"tk1msg1160908.gateway.edge.messenger.live-int.com"},"mib":{"resourcePath":"http://messengerweb.live-int.com/api","imageResourcePath":"http://messengerweb.live-int.com/api","styleResourcePath":"http://messengerweb.live-int.com/api","audioResourcePath":"http://messengerweb.live-int.com/api","applicationPath":"http://messengerweb.live-int.com/api","consentHostName":"mib-consent.messenger.services.live-int.com","serviceHostName":"messengerweb.live-int.com","applicationHostName":"messengerweb.live-int.com"},updateSettings:function(loaderSettings,resources,appSettings){var settings=loaderSettings.messenger;var loader=Microsoft.Live.Core.Loader;var localizedStyleMarkets=["ar","ar-sa-psloc","de-de-psloc","ja","ja-jp-psloc","gu","he","hi","ko","kn","ml","mr","ta","te","th","zh-hk","zh-tw"];if(loaderSettings.resourceMarket){for(var i=0;i<localizedStyleMarkets.length;i++){if(loaderSettings.resourceMarket==localizedStyleMarkets[i]){this.localizedMarket=loaderSettings.resourceMarket;break;}}} window.__messengerPath=this._appendSeperator(settings.applicationPath)+this._appendSeperator(settings.version);if(loader._isArray(settings.resourcePath)){window.__messengerScriptPath=this._appendSeperator(settings.resourcePath[0])+this._appendSeperator(settings.version);} else{window.__messengerScriptPath=this._appendSeperator(settings.resourcePath)+this._appendSeperator(settings.version);} if(loaderSettings.configuration){window.__messengerScriptPath+=this._appendSeperator(loaderSettings.configuration);} if(settings.serviceHostName){window.__messengerSignInServer=settings.serviceHostName;} if(settings.consentHostName){window.__messengerConsentServer=settings.consentHostName;} if(appSettings&&appSettings["messenger.serviceHostName"]){settings.serviceHostNameOverride=appSettings["messenger.serviceHostName"];} if(appSettings&&appSettings["messenger.resourcePath"]){settings.scriptPathOverride=encodeURIComponent(window.__messengerScriptPath);} settings.environmentOverride="wx.production";if(appSettings&&appSettings.environment){settings.environmentOverride="wx."+appSettings.environment;} if(loaderSettings.configuration){settings.environmentOverride+=('.'+loaderSettings.configuration);} settings.scriptPath=encodeURIComponent(window.__messengerScriptPath);settings.documentDomain=encodeURIComponent(document.domain);if(loader._isArray(settings.resourcePath)){settings.baseUrl=this._appendSeperator(settings.resourcePath[0])+settings.version;} else{settings.baseUrl=this._appendSeperator(settings.resourcePath)+settings.version;} if(!window.postMessage){var channelUrl=document.location.protocol+"//"+document.location.host+"/channel.htm";settings.channelTypeQualifier="#&WLIFMt="+(settings.disableFlash?"i":"");settings.channelTypeQualifier+="&WLIFMp="+encodeURIComponent(channelUrl.toLowerCase());settings.channelTypeQualifier+="&WLIFMi="+resources["messenger_iframe"].frameId;} window.__microsoftChannelBaseURL=this._appendSeperator(settings.baseUrl);window.__microsoftChannelScriptURL="http://"+this._appendSeperator(settings.applicationHostName)+"applications/";},_appendSeperator:function(url){if(url&&url.charAt(url.length-1)!='/'){return url+'/';} return url;},getResourceUrl:function(relativePath){if(!relativePath){relativePath="";} var settings=Microsoft.Live.Core.Loader._settings.messenger;var path=settings.resourcePath;if(relativePath.match(/(\.jpg|\.gif|\.png)$/gi)){path=settings.imageResourcePath;} else if(relativePath.match(/(\.mp3|\.wav)$/gi)){path=settings.audioResourcePath;} var url;if(!Microsoft.Live.Core.Loader._isArray(path)){url=path;} else{var hash=Microsoft.Live.Core.Loader._computeFastHash(relativePath);url=path[hash%path.length];} if(relativePath.charAt(0)=='/'){relativePath=relativePath.substring(1);} url=this._appendSeperator(url)+this._appendSeperator(settings.version)+relativePath;return url;}});