
registerNamespace("Msn.PI.Exception");Msn.PI.Exception=function(_el,_arg){var _t=this;_t.Error=_arg;this.RenderUserMessage=function(){_t._element.innerHTML=me.Error.message;if(_t.Error!=null){_t._element.lastChild.innerHTML+=Msn.PI.Exception.ErrorMessage(_t.Error,"html");};};};Msn.PI.Exception.ErrorMessage=function(error,type){return(type=="xml")?"<error><number>{0}</number><name>{1}</name><message>{2}</message><description>{3}</description></error>".format((error.number&0xFFFF),error.name.toString(),error.message,error.description):"<p><div style='font-weight:bold'>Error:</div><div>Number: {0}</div><div>Name: {1}</div><div>Message: {2}</div><div>Description: {3}</div></p>".format((error.number&0xFFFF),error.name.toString(),error.message,error.description);};Msn.PI.Exception.ErrorObject=function(errNumber){var errObject;switch(parseInt(errNumber)){case 100:errObject={number:100,name:"HTTP_Continue",message:"Continue",description:"Continue"};break;case 101:errObject={number:101,name:"HTTP_Switching_Protocols",message:"Switching Protocols",description:"Switching Protocols"};break;case 200:errObject={number:200,name:"HTTP_OK",message:"OK",description:"OK"};break;case 201:errObject={number:201,name:"HTTP_Created",message:"Created",description:"Created"};break;case 202:errObject={number:202,name:"HTTP_Accepted",message:"Accepted",description:"Accepted"};break;case 203:errObject={number:203,name:"HTTP_NonAuthoritative_Information",message:"NonAuthoritative Information",description:"NonAuthoritative Information"};break;case 204:errObject={number:204,name:"HTTP_No_Content",message:"No Content",description:"No Content"};break;case 205:errObject={number:205,name:"HTTP_Reset_Content",message:"Reset Content",description:"Reset Content"};break;case 206:errObject={number:206,name:"HTTP_Partial_Content",message:"Partial Content",description:"Partial Content"};break;case 300:errObject={number:300,name:"HTTP_Multiple_Choices",message:"Multiple Choices",description:"Multiple Choices"};break;case 301:errObject={number:301,name:"HTTP_Moved_Permanently",message:"Moved Permanently",description:"Moved Permanently"};break;case 302:errObject={number:302,name:"HTTP_Moved_Temporarily",message:"Moved Temporarily",description:"Moved Temporarily"};break;case 303:errObject={number:303,name:"HTTP_See_Other",message:"See Other",description:"See Other"};break;case 304:errObject={number:304,name:"HTTP_Not_Modified",message:"Not Modified",description:"Not Modified"};break;case 305:errObject={number:305,name:"HTTP_Use_Proxy",message:"Use Proxy",description:"Use Proxy"};break;case 400:errObject={number:400,name:"HTTP_Bad_Request",message:"Bad Request",description:"Bad Request"};break;case 401:errObject={number:401,name:"HTTP_Unauthorized",message:"Unauthorized",description:"Unauthorized"};break;case 402:errObject={number:402,name:"HTTP_Payment_Required",message:"Payment Required",description:"Payment Required"};break;case 403:errObject={number:403,name:"HTTP_Forbidden",message:"Forbidden",description:"Forbidden"};break;case 404:errObject={number:404,name:"HTTP_Not_Found",message:"Not Found",description:"Not Found"};break;case 405:errObject={number:405,name:"HTTP_Method_Not_Allowed",message:"Method Not Allowed",description:"Method Not Allowed"};break;case 406:errObject={number:406,name:"HTTP_Not_Acceptable",message:"Not Acceptable",description:"Not Acceptable"};break;case 407:errObject={number:407,name:"HTTP_Proxy_Authentication_Required",message:"Proxy Authentication Required",description:"Proxy Authentication Required"};break;case 408:errObject={number:408,name:"HTTP_Request_TimeOut",message:"Request TimeOut",description:"Request TimeOut"};break;case 409:errObject={number:409,name:"HTTP_Conflict",message:"Conflict",description:"Conflict"};break;case 410:errObject={number:410,name:"HTTP_Gone",message:"Gone",description:"Gone"};break;case 411:errObject={number:411,name:"HTTP_Length_Required",message:"Length Required",description:"Length Required"};break;case 412:errObject={number:412,name:"HTTP_Precondition_Failed",message:"Precondition Failed",description:"Precondition Failed"};break;case 413:errObject={number:413,name:"HTTP_Request_Entity_Too_Large",message:"Request Entity Too Large",description:"Request Entity Too Large"};break;case 414:errObject={number:414,name:"HTTP_RequestURL_Too_Large",message:"RequestURL Too Large",description:"RequestURL Too Large"};break;case 415:errObject={number:415,name:"HTTP_Unsupported_Media_Type",message:"Unsupported Media Type",description:"Unsupported Media Type"};break;case 500:errObject={number:500,name:"HTTP_Server_Error",message:"Server Error",description:"Server Error"};break;case 501:errObject={number:501,name:"HTTP_Not_Implemented",message:"Not Implemented",description:"Not Implemented"};break;case 502:errObject={number:502,name:"HTTP_Bad_Gateway",message:"Bad Gateway",description:"Bad Gateway"};break;case 503:errObject={number:503,name:"HTTP_Out_Of_Resources",message:"Out Of Resources",description:"Out Of Resources"};break;case 504:errObject={number:504,name:"HTTP_Gateway_TimeOut",message:"Gateway TimeOut",description:"Gateway TimeOut"};break;case 505:errObject={number:505,name:"HTTP_Version_Not_supported",message:"Version Not supported",description:"Version Not supported"};break;case 12007:errObject={number:12007,name:"HTTP_Unknown",message:"Unknown",description:"Unknown"};break;default:errObject={number:0,name:"PI_Unkown",message:"Unknown",description:"Unknown"};break;};return errObject;};Msn.PI.Exception.registerClass("Msn.PI.Exception");registerNamespace("Msn.PI.Response.Request");Msn.PI.Response.Request=function(_el,_arg,_ns){Msn.PI.Response.Request.initializeBase(this,arguments);var _t=this;_t.escapeurl=(!_arg.escape||typeof _arg.escape=="undefined")?Msn.PI.Util.ToBoolean(_arg.escape):true;_t.doparse=(!_arg.parse||typeof _arg.parse=="undefined")?Msn.PI.Util.ToBoolean(_arg.parse):true;_t.responseObject=null;_t.responseBinding=null;_t.url=_t.servicePath=_t.responseinfo=null;this.initialize=function(_own){Msn.PI.Response.Request.getBaseMethod(this,"initialize","Web.Bindings.Base").call(this,_own);_t.url=_arg.feedurl;if(_t.escapeurl){_t.url=_t.url.replace("&","%26");};var servicePath=(!_arg.storycount)?_arg.localpath:_arg.localpath.replace(/returnheadlines=.+&/,"returnheadlines={0}&".format(_arg.storycount));Web.Network.createRequest(_arg.type,"{0}{1}{2}".format((servicePath.indexOf("http://")==-1)?Msn.PI.Util.GetBaseUrl():"",servicePath,_t.url),_t,function(response){FetchCallback(response);}).execute();};this.dispose=function(_bUnld){_t=_t.url=_t.servicePath=_t.responseObject=_t.responseBinding=_t.responseinfo=_el=_arg=_t.parent=null;Msn.PI.Response.Request.getBaseMethod(this,"dispose","Web.Bindings.Base").call(this,_bUnld);};function FetchCallback(response){_t.responseinfo={response:response,hasError:false,error:null};_t.responseinfo.error=new Msn.PI.Exception.ErrorObject(response.status);_t.responseBinding=Web.Bindings.attachElementBindingSync(_t._element,"Msn.PI.Response.Parser",_t.parentScope.getBinding(),null,_ns);_t.responseObject=(_t.doparse)?_t.responseBinding.parse(_t.responseinfo):_t.responseinfo;_t.fire("onresponsecomplete",_t);};};Msn.PI.Response.Request.registerClass("Msn.PI.Response.Request","Web.Bindings.Base");Msn.PI.Response.Request.Events=Web.Enum.create("onbase","onresponsecomplete");registerNamespace("Msn.PI.Response.Parser");Msn.PI.Response.Parser=function(_el,_arg,_ns){Msn.PI.Response.Parser.initializeBase(this,arguments);var _t=this;_t.parsedResponse=null;this.initialize=function(_own){Msn.PI.Response.Parser.getBaseMethod(this,"initialize","Web.Bindings.Base").call(this,_own);};this.dispose=function(_bUnld){_t=_t.parsedResponse=_el=_arg=null;Msn.PI.Response.Parser.getBaseMethod(this,"dispose","Web.Bindings.Base").call(this,_bUnld);};this.parse=function(info){var response=info.response;var root;var xmlDoc=response.responseXML;if(!window.opera&&(!xmlDoc||!xmlDoc.xml||xmlDoc.xml.length==0)){xmlDoc=XMLDOMDocument();xmlDoc.loadXML(response.responseText);};root=xmlDoc.documentElement;if(root!=null){info[root.nodeName]=CreateObjectFromNode(root);}
else{info.hasError=true;info.error=new Msn.PI.Exception.ErrorObject(response.status);};return info;function CreateObjectFromNode(node){var parsedObj={attributes:null,nodes:null};if(node.attributes){parsedObj.attributes=new Object();for(var a=0;a<node.attributes.length;a++){parsedObj.attributes[node.attributes[a].nodeName]=node.attributes[a].nodeValue;};};if(node.childNodes.length){for(var n=0;n<node.childNodes.length;n++){if(Msn.PI.Util.IsTextNode(node.childNodes[n])){parsedObj.text=node.childNodes[n].nodeValue;}
else if(node.childNodes[n].nodeType==1){if(typeof parsedObj[node.childNodes[n].nodeName]!="undefined"){if(parsedObj[node.childNodes[n].nodeName].length==1){delete parsedObj[node.childNodes[n].nodeName].length;parsedObj[node.childNodes[n].nodeName]=new Array(parsedObj[node.childNodes[n].nodeName]);};parsedObj[node.childNodes[n].nodeName].push(CreateObjectFromNode(node.childNodes[n]));}
else{parsedObj[node.childNodes[n].nodeName]=CreateObjectFromNode(node.childNodes[n]);parsedObj[node.childNodes[n].nodeName].length=1;};};};};return parsedObj;};};function XMLDOMDocument(){var xmlDoc=null;if(window.DOMParser&&window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__&&typeof Document.prototype.loadXML=="undefined"){Document.prototype.loadXML=function(xmlstring){var doc=(new DOMParser()).parseFromString(xmlstring,"text/xml");while(this.hasChildNodes()){this.removeChild(this.lastChild);};for(var i=0;i<doc.childNodes.length;i++){this.appendChild(this.importNode(doc.childNodes[i],true));};this.readyState=4;};};try{if(document.implementation&&document.implementation.createDocument){xmlDoc=document.implementation.createDocument("","",null);if(xmlDoc.readyState==null){xmlDoc.readyState=1;xmlDoc.addEventListener("load",function(){xmlDoc.readyState=4;if(typeof xmlDoc.onreadystatechange=="function"){xmlDoc.onreadystatechange();}},false);};}
else if(window.ActiveXObject){try{xmlDoc=new ActiveXObject("Msxml2.DOMDocument.4.0");}catch(ex){;};try{xmlDoc=new ActiveXObject("Msxml2.DOMDocument.3.0");}catch(ex){;};try{xmlDoc=new ActiveXObject("MSXML4.DOMDocument");}catch(ex){;};try{xmlDoc=new ActiveXObject("MSXML3.DOMDocument");}catch(ex){;};try{xmlDoc=new ActiveXObject("MSXML2.DOMDocument");}catch(ex){;}
try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");}catch(ex){;}};return xmlDoc;}catch(ex){throw new Error("Your browser does not support XmlDocument objects");};};};Msn.PI.Response.Parser.registerClass("Msn.PI.Response.Parser","Web.Bindings.Base");Msn.PI.Response.Parser.Events=Web.Enum.create("onbase");registerNamespace("Msn.PI.Repeater");Msn.PI.Repeater=function(_el,_arg,_ns){Msn.PI.Repeater.initializeBase(this,arguments);var _t=this;_t.MIN_REPEATLENGTH=60;_t.intervalId=null;_t.expr=_arg.expr;_t.millis=((_arg.secs&&_arg.secs>=_t.MIN_REPEATLENGTH)?Web.Conversion.coerceInt(_arg.secs):_t.MIN_REPEATLENGTH)*1000;this.initialize=function(_own){Msn.PI.Repeater.getBaseMethod(this,"initialize","Web.Bindings.Base").call(this,_own);_t.intervalId=window.setInterval(_t.expr,_t.millis);};this.dispose=function(_bUnld){window.clearInterval(_t.intervalId);_t=_t.MIN_REPEATLENGTH=_t.intervalId=_t.expr=_t.millis=_el=_arg=_ns=null;Msn.PI.Repeater.getBaseMethod(this,"dispose","Web.Bindings.Base").call(this,_bUnld);};};Msn.PI.Repeater.registerClass("Msn.PI.Repeater","Web.Bindings.Base");Msn.PI.Repeater.Events=Web.Enum.create("onbase");registerNamespace("Msn.PI.Gadget.Base");Msn.PI.Gadget.Base=function(_el,_arg,_ns){Msn.PI.Gadget.Base.initializeBase(this,arguments);var _t=this;_t.parent=null;_arg=this.getParameters();_t.boundEvents=new Array();this.initialize=function(_own){Msn.PI.Gadget.Base.getBaseMethod(this,"initialize","Web.Bindings.Base").call(this,_own);};this.dispose=function(_bUnld){_t=_t.parent=_t.boundEvents=_el=_arg=null;Msn.PI.Gadget.Base.getBaseMethod(this,"dispose","Web.Bindings.Base").call(this,_bUnld);};this.setParentBinding=function(parent){_t.parent=parent;};this.bindEvent=function(object,eventname,fnhandle){object.attachEvent(eventname,fnhandle);_t.boundEvents.push({obj:object,evt:eventname,fn:fnhandle});};this.unbindEvents=function(){for(var i=_t.boundEvents.length-1;i>=0;i--){_t.boundEvents[i].obj.detachEvent(_t.boundEvents[i].evt,_t.boundEvents[i].fn);_t.boundEvents[i].obj=null;_t.boundEvents[i]=null;};};Msn.PI.Gadget.Base.registerBaseMethod(this,"bindEvent");Msn.PI.Gadget.Base.registerBaseMethod(this,"unbindEvents");Msn.PI.Gadget.Base.registerBaseMethod(this,"initialize");Msn.PI.Gadget.Base.registerBaseMethod(this,"dispose");};Msn.PI.Gadget.Base.registerClass("Msn.PI.Gadget.Base","Web.Bindings.Base");Msn.PI.Gadget.Base.Events=Web.Enum.create("onbase");registerNamespace("Msn.PI.Gadget.Icon");Msn.PI.Gadget.Icon=function(_el,_arg,_ns){Msn.PI.Gadget.Icon.initializeBase(this,arguments);var _t=this;_t.iconName="";this.initialize=function(_own){Msn.PI.Gadget.Icon.getBaseMethod(this,"initialize","Msn.PI.Gadget.Base").call(this,_own);_t._element.attachEvent("onmousedown",gadgetDown);_t._element.attachEvent("onkeydown",gadgetDown);_t._element.attachEvent("onclick",cancelGadgetDown);_t.render();};this.dispose=function(_bUnld){_t._element.detachEvent("onmousedown",gadgetDown);_t._element.detachEvent("onkeydown",gadgetDown);_t._element.detachEvent("onclick",cancelGadgetDown);_t=_t.iconName=_el=_arg=_ns=null;Msn.PI.Gadget.Icon.getBaseMethod(this,"dispose","Msn.PI.Gadget.Base").call(this,_bUnld);};this.render=function(){_t._element.src="{0}{1}{2}.gif".format(_arg.imgpath,_t._objDeclaration.objScope.getBinding().parentArgs.resourceprefix,_t.iconName);_t._element.width=_t._element.height="15";_t._element.tabIndex=0;_t._element.align="absmiddle";_t._element.alt="";};function gadgetDown(){_t.fire("ongadgetdown",_t);};function cancelGadgetDown(){if(window.event.stopPropagation){window.event.stopPropagation();};if(window.event.preventDefault){window.event.preventDefault();};window.event.cancelBubble=true;window.event.returnValue=false;return false;};Msn.PI.Gadget.Icon.registerBaseMethod(this,"initialize");Msn.PI.Gadget.Icon.registerBaseMethod(this,"dispose");Msn.PI.Gadget.Icon.registerBaseMethod(this,"render");};Msn.PI.Gadget.Icon.registerClass("Msn.PI.Gadget.Icon","Msn.PI.Gadget.Base");Msn.PI.Gadget.Icon.Events=Web.Enum.create("ongadgetdown");registerNamespace("Msn.PI.Module.Base");Msn.PI.Module.Base=function(_el,_arg,_ns){Msn.PI.Module.Base.initializeBase(this,arguments);var _t=this;_t.container=null;_t.mainbody=null;_t.header=null;_t.footer=null;_t.boundGadgets=new Array();_t.newGadgets=new Array();_t.boundEvents=new Array();_t.stateFlag=Web.Flags.create("Removed",0,"Open",1,"Closed",2);_arg=_t.getParameters();_t.isPersisted=Msn.PI.Util.ToBoolean(_arg.persist);_t.moduleState={s:1};_t.isOpen=true;_t.isExpandable=(Msn.PI.Util.GetEscapedValue(_arg.isexpandable)!="")?Msn.PI.Util.ToBoolean(_arg.isexpandable):false;this.initialize=function(_own){Msn.PI.Module.Base.getBaseMethod(this,"initialize","Web.Bindings.Base").call(this,_own);if(Msn.PI.Util.GetEscapedValue(_t.getIdentity())==""&&Msn.PI.Util.GetEscapedValue(_t._element.getAttribute("id"))!=""){_t._element.setAttribute("{0}:id".format(_ns),_t._element.getAttribute("id"));};if(_t.isPersisted){if(_t.getIdentity()==""){_t._element.setAttribute(_ns+":id",setIdentity(_t._element,""));};_t.moduleState=_t.getState();_t.isOpen=(_t.moduleState.s==Web.Conversion.coerceInt(_t.stateFlag["Open"]))?true:false};if(!Msn.PI.Util.ClassContains(_t._element,"Msn.PI.Module.Header")&&(!_t.isPersisted||(_t.isPersisted&&_t.moduleState.s!=Web.Conversion.coerceInt(_t.stateFlag["Removed"])))){_t.registerFor("Msn.PI.Module.Header",headerInit,_t._element);};};function setIdentity(el,id){var elParent=el.parentElement;var counter=1;var sib=el.previousSibling;while(sib){counter++;sib=sib.previousSibling;};id="{0}{1}{2}".format(id,el.tagName.substring(0,1),counter);if(elParent.getAttribute(_ns+":id")==null){return setIdentity(elParent,id);}
else{return"{0}{1}".format(elParent.getAttribute(_ns+":id"),id);};};this.dispose=function(_bUnld){_t.persistState();_t.unbindEvents();for(var i=0;i<_t.boundGadgets.length;i++){_t.boundGadgets.pop(_t.boundGadgets[i]);};for(var i=0;i<_t.newGadgets.length;i++){_t.newGadgets.pop(_t.newGadgets[i]);};_t=_t.boundGadgets=_t.newGadgets=_t.header=_t.moduleState=_t.stateFlag=_t.onPage=_el=_arg=_ns=null;Msn.PI.Module.Base.getBaseMethod(this,"dispose","Web.Bindings.Base").call(this,_bUnld);};this.bindEvent=function(object,eventname,fnhandle){object.attachEvent(eventname,fnhandle);_t.boundEvents.push({obj:object,evt:eventname,fn:fnhandle});};this.unbindEvents=function(){for(var i=_t.boundEvents.length-1;i>=0;i--){_t.boundEvents[i].obj.detachEvent(_t.boundEvents[i].evt,_t.boundEvents[i].fn);_t.boundEvents[i].obj=null;_t.boundEvents[i]=null;};};this.registerGadgets=function(parent_element){var gadgets=null;if(typeof _arg.bindgadgets!="undefined"&&_arg.bindgadgets){gadgets=_arg.bindgadgets.split("|");for(var i=0;i<gadgets.length;i++){eval("var gadget = {0};".format(gadgets[i]));_t.registerFor(gadget.type,gadget.callback,_t._element);};};};this.createGadgets=function(parent_element){var gadgets=_arg.addgadgets.split("|");for(var i=0;i<gadgets.length;i++){eval("var gadget = {0};".format(gadgets[i]));var selector=Web.Dom.Css.createRules(gadget.selector)[0];var _element=Msn.PI.Util.GetNamedElement(selector.strTagName,parent_element,selector.strClassName);_element.setAttribute("{0}:id".format(_ns),"gadget{0}".format(i));var args=_arg;args.isopen=_t.parent.isOpen;_t.newGadgets.push(Web.Bindings.attachElementBinding(_element,gadget.type,_t,args,_ns,gadget.callback,null,null,null));_t.newGadgets[_t.newGadgets.length-1].setParentBinding(_t);};};this.getState=function(){var cookieValue=Msn.PI.Util.ReadCookie("{0}{1}".format(_t.getIdentity(),(typeof _t.pid!="undefined")?_t.pid:""));return(Msn.PI.Util.GetEscapedValue(cookieValue)!="")?eval("new Object({{0}});".format(cookieValue)):_t.moduleState;};this.setState=function(obj){_t.moduleState=obj;};this.persistState=function(){if(_t.isPersisted){var cookieValue="";for(var prop in _t.moduleState){if(typeof _t.moduleState[prop]=="string"){cookieValue+="{0}:'{1}',".format(prop,_t.moduleState[prop]);}
else{cookieValue+="{0}:{1},".format(prop,_t.moduleState[prop]);};};cookieValue=cookieValue.substring(0,cookieValue.length-1);Msn.PI.Util.WriteCookie("{0}{1}".format(_t.getIdentity(),(typeof _t.pid!="undefined")?_t.pid:""),cookieValue,null,"/");cookieValue=path=null;};};function headerInit(_oBind,_bState){var ancestor=(!_oBind._element)?null:compareIdentity(_oBind._element.parentElement,_t._element);function compareIdentity(elementA,elementB){if(elementA.getAttribute("{0}:id".format(_ns))==elementB.getAttribute("{0}:id".format(_ns))){return elementA;}
else if(elementA.parentElement.getAttribute("{0}:id".format(_ns))==elementB.getAttribute("{0}:id".format(_ns))){return elementA.parentElement;}
else{return null;};};if(!ancestor||(ancestor&&_bState&&ancestor.getAttribute("{0}:id".format(_ns))!=_t._element.getAttribute("{0}:id".format(_ns)))){return;};if(_bState&&!Web.Type.compare(_oBind,_t)&&_t.isPersisted){_t.header=_oBind;_oBind.render(_t);if(_oBind._element.nextSibling&&_t.moduleState.s==Web.Conversion.coerceInt(_t.stateFlag["Closed"])){var sibling=_oBind._element.nextSibling;while(sibling){if(sibling.nodeType==1){Msn.PI.Util.AddClass(sibling,"none");}
else if(Msn.PI.Util.IsTextNode(sibling)&&sibling.length<=1&&(sibling.nodeValue==" "||"")){sibling.parentNode.removeChild(sibling);};sibling=sibling.nextSibling;};_oBind._element.style.borderBottomWidth="0px";};};};Msn.PI.Module.Base.registerBaseMethod(this,"initialize");Msn.PI.Module.Base.registerBaseMethod(this,"dispose");Msn.PI.Module.Base.registerBaseMethod(this,"persistState");};Msn.PI.Module.Base.registerClass("Msn.PI.Module.Base","Web.Bindings.Base");Msn.PI.Module.Base.Events=Web.Enum.create("onbase");registerNamespace("Msn.PI.Module.Header");Msn.PI.Module.Header=function(_el,_arg,_ns){Msn.PI.Module.Header.initializeBase(this,arguments);var _t=this;_t.parent=null;_t.parentArgs=null;_t.iconContainer=null;this.initialize=function(_own){Msn.PI.Module.Header.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);};this.dispose=function(_bUnld){_t=_t.parent=_t.parentArgs=_t.iconContainer=_el=_arg=_ns=null;Msn.PI.Module.Header.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};this.render=function(parent){_t.parent=parent;_t.parentArgs=_t.parent.getParameters();if(Msn.PI.Util.ToBoolean(_t.parentArgs.isexpandable)||Msn.PI.Util.ToBoolean(_t.parentArgs.hascontext)){_t.iconContainer=Msn.PI.Util.GetNamedElement("span",_t._element,"mticons",(Msn.PI.Util.IsTextNode(_t._element.firstChild)?"afterbegin":"beforeend"));_t.createGadgets(_t.iconContainer);};_t.fire("onrendercomplete",_t);};Msn.PI.Module.Header.registerBaseMethod(this,"initialize");Msn.PI.Module.Header.registerBaseMethod(this,"dispose");Msn.PI.Module.Header.registerBaseMethod(this,"render");};Msn.PI.Module.Header.registerClass("Msn.PI.Module.Header","Msn.PI.Module.Base");Msn.PI.Module.Header.Params=Web.Enum.create("addgadgets","persist","imgpath");Msn.PI.Module.Header.Events=Web.Enum.create("onrendercomplete");Msn.PI.Util=new function(){;};Msn.PI.Util.GetBaseUrl=function(){if(window.location.protocol.toLowerCase().startsWith("http")){return"{0}/{1}{2}/".format(window.location.protocol,"/",window.location.host);};return"";};Msn.PI.Util.GetPageName=function(){return window.location.pathname.substring(window.location.pathname.lastIndexOf("/"));};Msn.PI.Util.GetEscapedValue=function(val){return(val&&val!=""&&typeof val!="undefined")?val:"";};Msn.PI.Util.SetCssFloat=function(element,direction){if(Web.Browser.isMozilla()){element.style.cssFloat=direction;}
else{element.style.styleFloat=direction;};};Msn.PI.Util.GetHandCursor=function(){return(Web.Browser.isMozilla())?"pointer":"hand";};Msn.PI.Util.ReadCookie=function(name){var cookieName=name+"=";var ca=document.cookie.split(';');if(ca!=null){for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1,c.length);};if(c.indexOf(cookieName)==0){return c.substring(cookieName.length,c.length);};};};return null;};Msn.PI.Util.WriteCookie=function(cookieName,cookieValue,expiryDate,path){var newExpiry;if(expiryDate!=null||expiryDate!=""){newExpiry=new Date();newExpiry.setYear(newExpiry.getFullYear()+5);}
else{newExpiry=expiryDate;};if(typeof document!="undefined"){document.cookie="{0}={1};expires={2};path={3};".format(cookieName,cookieValue,newExpiry.toGMTString(),path);return true;};return false;};Msn.PI.Util.ExpireCookie=function(cookieName,path){if(Msn.PI.Util.ReadCookie(cookieName,'')!=null){var yesterday=new Date();yesterday.setDate(yesterday.getDate()-1);Msn.PI.Util.WriteCookie(cookieName,'',yesterday,path);};return;};Msn.PI.Util.MigrateModuleState=function(obj,oldCookieName){var oldCookieValue=Msn.PI.Util.ReadCookie(oldCookieName,'');var newCookieValue=(typeof obj.pid!="undefined")?Msn.PI.Util.ReadCookie("{0}{1}".format(obj.getIdentity(),obj.pid)):null;if(oldCookieValue!=null&&!newCookieValue){obj.setState(eval("new Object({{0}});".format(oldCookieValue)));Msn.PI.Util.ExpireCookie(oldCookieName,"/");};oldCookieValue=newCookieValue=null;return;};Msn.PI.Util.SelectNodeHelper=function(node,xpath){var tmp=node.selectSingleNode(xpath);if(tmp!=null){return(xpath.indexOf("@")>-1)?tmp.value:tmp.text;}
else{return"";};};Msn.PI.Util.NodePosition=function(pos){return(!Web.Browser.isIE())?pos+1:pos;};Msn.PI.Util.Date=function(date){var regEx=/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}).([0-9]{7})(\+|\-)([0-9]{1,2}):([0-9]{1,2})/;var matches=regEx.exec(date);if(matches!=null){var year=Math.round(matches[1]);var month=Math.round(matches[2])-1;var day=Math.round(matches[3]);var tzdiff=matches[8];var tzhour=Math.round(matches[9]);var tzmin=Math.round(matches[10]);var hour=(tzdiff=="-")?(Math.round(matches[4])-1)-tzhour:(Math.round(matches[4])-1)+tzhour;var min=(tzdiff=="-")?(Math.round(matches[5])-1)-tzmin:(Math.round(matches[5])-1)+tzmin;var sec=Math.round(matches[6])-1;var msec=Math.round(matches[7])-1;return new Date(year,month,day,hour,min,sec,msec);};var dt=new Date(date);return new Date(dt.getUTCFullYear(),dt.getUTCMonth(),dt.getUTCDate(),dt.getUTCHours(),dt.getUTCMinutes(),dt.getUTCSeconds(),dt.getUTCMilliseconds());};Msn.PI.Util.ToBoolean=function(val){if(Web.Type.isBoolean(val)){return val;}
else if(Msn.PI.Util.GetEscapedValue(val).toLowerCase()=="true"){return true;};return false;};Msn.PI.Util.GetNamedElement=function(tagName,parent,className,sWhere){var element;if(Msn.PI.Util.GetEscapedValue(tagName)==""){element=document.createTextNode(" ");parent.appendChild(element);}
else{element=document.createElement(tagName);if(className!=""){element.className=className;};parent.insertAdjacentElement((Msn.PI.Util.GetEscapedValue(sWhere)=="")?"beforeend":sWhere,element);};return element;};Msn.PI.Util.GetEventElement=function(name,evt){if(name=="src"){return(Web.Browser.isMozilla())?evt.target:evt.srcElement;}
else if(name=="to"){return(Web.Browser.isMozilla())?evt.relatedTarget:evt.toElement;};return null;};Msn.PI.Util.CancelEvent=function(evt){evt.cancelBubble=true;if(evt.stopPropagation){evt.stopPropagation();};evt.returnValue=false;if(evt.preventDefault){evt.preventDefault();};return false;};Msn.PI.Util.SetSubmitButtonClick=function(_o,fn){var inputElements=Web.Dom.getElementsByCssSelector("input",_o.form);for(var i=0;i<inputElements.length;i++){var inputItem=inputElements[i];if(inputItem.type=="submit"){inputItem.type="button";_o.bindEvent(inputItem,"onclick",fn);break;};};};Msn.PI.Util.AddClass=function(element){var classes=element.className.split(" ");var len=arguments.length;for(var i=1;i<len;i++){var op=arguments[i].slice(0,1);var cls=(arguments[i].substring(0,1)==" ")?arguments[i].slice(1):arguments[i];var idx=classes.indexOf(cls);if(op=="-"){if(idx!=-1){classes.splice(idx,1);};}
else{if(idx==-1){classes.push(cls);};};};var newClass=classes.join(" ");if(element.className!=newClass){element.className=newClass;};};Msn.PI.Util.RemoveClass=function(element,className){element.className=element.className.replace((element.className.indexOf(" ")>-1)?" {0}".format(className):className,"");};Msn.PI.Util.ToggleClass=function(element,className){if(element.className.indexOf(className)>-1){Msn.PI.Util.RemoveClass(element,className);}
else{Msn.PI.Util.AddClass(element,className);};};Msn.PI.Util.ClassContains=function(element,className){return(new RegExp(" ?{0} ?".format(className),"ig")).test(element.className);};Msn.PI.Util.ParseHTML=function(fullString){if(typeof fullString=="undefined"){return{text:"",link:null};};fullString=fullString.replace(/\n|\r/g,"");fullString=fullString.trim();fullString=fullString.replace(/"/g,"");fullString=fullString.replace(/'/g,"");var regEx=new RegExp("","");var expressionMatch,expressionMatch,linkTag;regEx.compile("<\s*script(?:.*?)\/script\s*>","i");while(regEx.exec(fullString)!=null){fullString=RegExp.leftContext+RegExp.rightContext;};regEx.compile("(<(?:!--|\/)?([a-zA-Z0-9]+)(?:\s*?.*?)(?:--|\/)?>)","i");while(regEx.exec(fullString)!=null){if(RegExp.$2.toLowerCase()=="a"&&typeof linkTag=="undefined"){linkTag=RegExp.$1;};fullString=RegExp.leftContext+RegExp.rightContext;};regEx=null;if(typeof linkTag!="undefined"){linkTag=linkTag.match(/href=.*( |>)/i)[0].trim().replace(/href=|>/g,"");};return{text:fullString,link:linkTag};};Msn.PI.Util.CropText=new Object();Msn.PI.Util.CropText.CalcLineHeight=function(element){if(Msn.PI.Util.IsTextNode(element)){element=element.parentNode;};var ruler=rulerunit=this.height=null;ruler=Msn.PI.Util.GetNamedElement("div",document.getElementsByTagName("body")[0],"");ruler.style.width="0ex";ruler.innerText="&nbsp;";rulerunit=(element.currentStyle.lineHeight&&element.currentStyle.lineHeight!="auto")?element.currentStyle.lineHeight.substring(element.currentStyle.lineHeight.length-2,element.currentStyle.lineHeight.length):"pt";ruler.style.lineHeight=(element.currentStyle.lineHeight&&element.currentStyle.lineHeight!="auto")?"{0}{1}".format(Web.Conversion.coerceInt(element.currentStyle.lineHeight.replace(rulerunit))+2,rulerunit):"10.08pt";this.height=ruler.offsetHeight;document.getElementsByTagName("body")[0].removeChild(ruler);ruler=rulerunit=null;return Web.Conversion.coerceInt(this.height);};Msn.PI.Util.CropText.ByContainerDimension=function(element,size,dim){var textNode=(element.childNodes.length>0)?element.firstChild:element;var text=(typeof textNode.innerHTML!="undefined")?textNode.innerHTML:textNode.nodeValue;element.title=text;var origlength=text.length;if(origlength==0){return;}
else{var ellipsisRegEx=lastWordRegEx=new RegExp("","");ellipsisRegEx.compile(" ?(\\.\\.\\.|\\\\u2026)$","");lastWordRegEx.compile("(\\b| )(\\S|\\.)+?$","");while(!Msn.PI.Util.CropText.CheckDimensionFit(dim,element,size)){if(text.indexOf(" ")==-1){text=text.substring(0,text.length-1).replace(ellipsisRegEx,"");}
else{text=text.trim().replace(lastWordRegEx,"").replace(ellipsisRegEx,"");};if(typeof textNode.innerHTML!="undefined"){textNode.innerHTML=Msn.PI.Util.CropText.AppendEllipsis(text.trim().replace(ellipsisRegEx,""));}
else{textNode.nodeValue=Msn.PI.Util.CropText.AppendEllipsis(text.trim().replace(ellipsisRegEx,""));};}
ellipsisRegEx=lastWordRegEx=null;};};Msn.PI.Util.CropText.CheckFit=function(dim1,dim2){return(Web.Conversion.coerceInt(dim1)<=Web.Conversion.coerceInt(dim2));};Msn.PI.Util.CropText.CheckDimensionFit=function(dim,element,size){return(Msn.PI.Util.CropText.CheckFit(dim==0?element.offsetWidth:element.offsetHeight,size));};Msn.PI.Util.CropText.AppendEllipsis=function(txt){return"{0}{1}".format(txt,!txt.endsWith(".")?"\u2026":"");};Msn.PI.Util.CropText.ByContainerWidth=function(element,width){Msn.PI.Util.CropText.ByContainerDimension(element,width,0);};Msn.PI.Util.CropText.ByContainerHeight=function(element,lines){var maxHeight=((typeof lines!="undefined"&&lines)?Web.Conversion.coerceInt(lines):1)*Msn.PI.Util.CropText.CalcLineHeight(element);Msn.PI.Util.CropText.ByContainerDimension(element,maxHeight,1);};Msn.PI.Util.CropText.ByContainerWidthAndLines=function(element,width,lines){var maxHeight=((typeof lines!="undefined"&&lines)?Web.Conversion.coerceInt(lines):1)*Msn.PI.Util.CropText.CalcLineHeight(element);if(!Msn.PI.Util.CropText.CheckFit(element.offsetHeight,maxHeight)){Msn.PI.Util.CropText.ByContainerDimension(element,maxHeight,1);}
if(!Msn.PI.Util.CropText.CheckFit(element.offsetWidth,width)){Msn.PI.Util.CropText.ByContainerDimension(element,width,0);}};Msn.PI.Util.IsTextNode=function(node){return(node.nodeType==3);};registerNamespace("Msn.PI.NC.Gadget.Expander");Msn.PI.NC.Gadget.Expander=function(_el,_arg,_ns){Msn.PI.NC.Gadget.Expander.initializeBase(this,arguments);var _t=this;_t.isOpen=_arg.isopen;this.initialize=function(_own){_t.iconName=(_t.isOpen)?"Open":"Closed";Msn.PI.NC.Gadget.Expander.getBaseMethod(this,"initialize","Msn.PI.Gadget.Icon").call(this,_own);};this.dispose=function(_bUnld){_t=_t.isOpen=_el=_arg=_ns=null;Msn.PI.NC.Gadget.Expander.getBaseMethod(this,"dispose","Msn.PI.Gadget.Icon").call(this,_bUnld);};this.render=function(){_t.iconName=(_t.isOpen)?"Closed":"Open";Msn.PI.NC.Gadget.Expander.getBaseMethod(this,"render","Msn.PI.Gadget.Icon").call(this);_t.isOpen=!_t.isOpen;};};Msn.PI.NC.Gadget.Expander.registerClass("Msn.PI.NC.Gadget.Expander","Msn.PI.Gadget.Icon");Msn.PI.NC.Gadget.Expander.Events=Web.Enum.create("ongadgetdown");registerNamespace("Msn.PI.NC.Gadget.Remover");Msn.PI.NC.Gadget.Remover=function(_el,_arg,_ns){Msn.PI.NC.Gadget.Remover.initializeBase(this,arguments);var _t=this;this.initialize=function(_own){_t.iconName="Kill";Msn.PI.NC.Gadget.Remover.getBaseMethod(this,"initialize","Msn.PI.Gadget.Icon").call(this,_own);};this.dispose=function(_bUnld){_t=_el=_arg=_ns=null;Msn.PI.NC.Gadget.Remover.getBaseMethod(this,"dispose","Msn.PI.Gadget.Icon").call(this,_bUnld);};};Msn.PI.NC.Gadget.Remover.registerClass("Msn.PI.NC.Gadget.Remover","Msn.PI.Gadget.Icon");Msn.PI.NC.Gadget.Remover.Events=Web.Enum.create("ongadgetdown");registerNamespace("Msn.PI.NC.Module.Basic");Msn.PI.NC.Module.Basic=function(_el,_arg,_ns){Msn.PI.NC.Module.Basic.initializeBase(this,arguments);var _t=this;_arg=_t.getParameters();_t.pid=_arg.pid;this.initialize=function(_own){Msn.PI.NC.Module.Basic.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);};this.dispose=function(_bUnld){_t=_el=_arg=_ns=null;Msn.PI.NC.Module.Basic.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};};Msn.PI.NC.Module.Basic.registerClass("Msn.PI.NC.Module.Basic","Msn.PI.Module.Base");Msn.PI.NC.Module.Basic.Params=Web.Enum.create("isexpandable","hascontext","isremoveable","resourceprefix","persist","pid");registerNamespace("Msn.PI.NC.Gadget.Ticker");Msn.PI.NC.Gadget.Ticker=function(_el,_arg,_ns){Msn.PI.NC.Gadget.Ticker.initializeBase(this,arguments);var _t=this;_arg=this.getParameters();_t.refresh=(_arg.refresh&&typeof _arg.refresh!="undefined")?Web.Conversion.coerceInt(_arg.refresh):0;_t.style=(_arg.style&&typeof _arg.style!="undefined")?Web.Conversion.coerceInt(_arg.style):0;window.xInterval=window.yInterval=_t.pause=null;window.tickXSpeed=17*((Web.Browser.isMozilla())?1.5:1);window.tickYSpeed=15;_t.pauseMs=2000;_t.newlist=_t.list=null;window.tickCurrentItem=null;_t.response=null;this.initialize=function(_own){Msn.PI.NC.Gadget.Ticker.getBaseMethod(this,"initialize","Msn.PI.Gadget.Base").call(this,_own);SetScroller();if(_t.refresh>0){Web.Bindings.attachElementBinding(_t._element,"Msn.PI.Repeater",_t,{expr:_t.getContentRefresh,secs:_t.refresh},_ns,null,null,null,null);};};this.dispose=function(_bUnld){if(_t.list.childNodes){for(var t=0;t<_t.list.childNodes.length;t++){_t.list.removeChild(_t.list.childNodes[t]);};};_t=_t.response=_t.refresh=window.xInterval=window.yInterval=_t.newlist=_t.list=_t.pause=_t.pauseMS=window.tickCurrentItem=_el=_arg=_ns=null;Msn.PI.NC.Gadget.Ticker.getBaseMethod(this,"dispose","Msn.PI.Gadget.Base").call(this,_bUnld);};this.getContentRefresh=function(){Web.Bindings.attachElementBinding(_t._element,"Msn.PI.Response.Request",_t,{type:Web.Network.Type.XML,feedurl:"",localpath:"{0}{1}service.aspx?cp-rpageid={2}&cp-contentid={3}".format((_arg.base&&typeof _arg.base!="undefined")?_arg.base:"",_arg.service,_arg.pid,_arg.cid),storycount:null,parse:true},_ns,contentCallback,null,null,null);};function contentCallback(_oBind){if(!_oBind.responseObject){_t.bindEvent(_oBind,"onresponsecomplete",responseBound);}
else{responseBound(_oBind);};};function responseBound(_oBind){if(typeof _oBind.Package!="undefined"){_oBind=_oBind.Package;};if(!_oBind.responseObject.hasError&&_oBind.responseObject.response.status==200){_t.response=_oBind.responseObject;_t.build();};};this.build=function(){window.clearInterval(window.xInterval||window.yInterval);window.xInterval=window.yInterval=null;_t.newlist=Msn.PI.Util.GetNamedElement("ul",_t._element,"linklist16");var items=_t.response.ul.li;var item=listItem=listItemLink=null;for(var c=0;c<items.length;c++){listItem=Msn.PI.Util.GetNamedElement("li",_t.newlist,"");item=(typeof items[c]!="undefined")?items[c]:items;for(var atts in item.attributes){listItem.setAttribute(atts,item.attributes[atts]);};listItemLink=Msn.PI.Util.GetNamedElement("a",listItem,"");for(var atts in item.a.attributes){listItemLink.setAttribute(atts,item.a.attributes[atts]);};listItemLink.innerText=item.a.text;};items=item=listItem=listItemLink=null;_t._element.firstChild.removeChild(_t.list);SetScroller();};function SetScroller(){_t.list=_t._element.getElementsByTagName("ul");if(_t.list.length<=0){return;}
else{_t.list=_t.list[0];};if(Msn.PI.Util.IsTextNode(_t._element.firstChild.firstChild)){Msn.PI.Util.GetNamedElement("span",_t._element.firstChild,"alt1","afterbegin").appendChild(_t._element.firstChild.removeChild(_t._element.firstChild.childNodes[1]));};_t.list=_t._element.firstChild.firstChild.insertAdjacentElement("afterend",_t.list.parentElement.removeChild(_t.list));if(!_t.response){_t._element.removeChild(_t._element.firstChild.nextSibling);_t._element.style.height="{0}px".format(_t._element.firstChild.offsetHeight);_t._element.style.borderBottomWidth="0px";};_t.list.style.width="{0}px".format(_t._element.offsetWidth-_t._element.firstChild.firstChild.offsetWidth-16);var listItem=null;for(var t=0;t<_t.list.childNodes.length;t++){listItem=_t.list.childNodes[t];listItem.style.whiteSpace="nowrap";listItem.tabIndex=-1;if(listItem.firstChild.tagName=="A"&&(listItem.firstChild.href==""||listItem.firstChild.href=="{0}{1}".format(Msn.PI.Util.GetBaseUrl(),_arg.base))){listItem.firstChild.removeAttribute("href",0);};listItem.firstChild.tabIndex=-1;listItem.setAttribute("pos",t);Msn.PI.Util.AddClass(listItem,"hide");listItem.style.left="{0}px".format(_t._element.firstChild.offsetWidth+1);listItem.style.top="{0}px".format(0-_t._element.firstChild.offsetTop+0);_t.bindEvent(listItem,"onmouseover",MouseOver);_t.bindEvent(listItem,"onmouseout",MouseOut);if(_t.style!=1){Msn.PI.Util.CropText.ByContainerWidth(listItem,_t.list.offsetWidth);};};listItem=null;window.tickCurrentItem=_t.list.firstChild;if(_t.style==0){MoveX(window.tickCurrentItem);}
else if(_t.style==1){MoveX_RightThruLeft(window.tickCurrentItem);};};function MoveX(item){if(!window.xInterval){Msn.PI.Util.ToggleClass(item,"hide");Msn.PI.Util.ToggleClass(item,"show");window.xInterval=window.setInterval(function(){MoveX(item);},window.tickXSpeed);return;};item.style.left="{0}px".format(item.offsetLeft-1);if(item.offsetLeft<=(_t._element.firstChild.firstChild.offsetLeft+_t._element.firstChild.firstChild.offsetWidth)-100){window.clearInterval(window.xInterval);window.xInterval=null;_t.pause=window.setInterval(function(){MoveY(item);},_t.pauseMs);};};function MoveY(item){if(_t.pause){window.clearInterval(_t.pause);_t.pause=null;};if(!window.yInterval){window.yInterval=window.setInterval(function(){MoveY(item);},window.tickYSpeed);return;};item.style.top="{0}px".format(item.offsetTop-1);if(item.offsetTop<0-item.offsetHeight){window.clearInterval(window.yInterval);window.yInterval=null;MoveNextItem(item);MoveX(window.tickCurrentItem);};};function MoveX_RightThruLeft(item){if(!window.xInterval){Msn.PI.Util.ToggleClass(item,"hide");Msn.PI.Util.ToggleClass(item,"show");window.xInterval=window.setInterval(function(){MoveX_RightThruLeft(item);},window.tickXSpeed);return;};item.style.left="{0}px".format(item.offsetLeft-1);if((item.offsetLeft+item.offsetWidth)<(_t._element.firstChild.firstChild.offsetLeft+_t._element.firstChild.firstChild.offsetWidth)-100){window.clearInterval(window.xInterval);window.xInterval=null;MoveNextItem(item);Msn.PI.Util.ToggleClass(window.tickCurrentItem,"show");Msn.PI.Util.ToggleClass(window.tickCurrentItem,"hide");window.xInterval=window.setInterval(function(){MoveX_RightThruLeft(window.tickCurrentItem);},window.tickXSpeed);};};function MoveNextItem(item){Msn.PI.Util.ToggleClass(item,"hide");Msn.PI.Util.ToggleClass(item,"show");item.style.left="{0}px".format(_t._element.offsetWidth+1);item.style.top="{0}px".format(0-_t._element.firstChild.offsetTop);window.tickCurrentItem=item.nextSibling||_t.list.firstChild;return;};function MouseOver(){window.clearInterval(window.xInterval||window.yInterval);};function MouseOut(){var evtElement=Web.Dom.getElementsByCssSelector(".show",_t.list)[0];if(_t.style==0){if(evtElement.offsetLeft>_t._element.firstChild.firstChild.offsetWidth+15){window.xInterval=window.setInterval(function(){MoveX(evtElement);},window.tickXSpeed);}
else{window.yInterval=window.setInterval(function(){MoveY(evtElement);},window.tickYSpeed);};}
else if(_t.style==1){window.xInterval=window.setInterval(function(){MoveX_RightThruLeft(evtElement);},window.tickXSpeed);};};};Msn.PI.NC.Gadget.Ticker.registerClass("Msn.PI.NC.Gadget.Ticker","Msn.PI.Gadget.Base");Msn.PI.NC.Gadget.Ticker.Params=Web.Enum.create("refresh","service","pid","cid","base","style");registerNamespace("Msn.PI.NC.Gadget.SlideControl");Msn.PI.NC.Gadget.SlideControl=function(_el,_arg,_ns){Msn.PI.NC.Gadget.SlideControl.initializeBase(this,arguments);var _t=this;_t.parent=null;_t.headerTitle=_t.previous=_t.next=null;_t.loopInitValue=_t.showLoop=null;_t.oldPos=_t.newPos=null;this.initialize=function(_own){Msn.PI.NC.Gadget.SlideControl.getBaseMethod(this,"initialize","Msn.PI.Gadget.Base").call(this,_own);_t.headerTitle=_t._element.parentElement.firstChild;_t.parent=_own.getBinding();var maxHeight=_t.parent.slides[0].element.offsetHeight;for(var s=0;s<_t.parent.slides.length;s++){maxHeight=Math.max(maxHeight,_t.parent.slides[s].element.offsetHeight);Msn.PI.Util.AddClass(_t.parent.slides[s].element,"none");};var slide=null;for(var s=0;s<_t.parent.slides.length;s++){slide=_t.parent.slides[s];slide.element.style.height="{0}px".format(maxHeight);slide.element.attachEvent("onmouseover",mouseOverSlide);slide.element.attachEvent("onmouseout",mouseOutSlide);};slide=maxHeight=null;Msn.PI.Util.RemoveClass(_t.parent.slides[0].element,"none");_t.headerTitle.removeChild(_t.headerTitle.firstChild);_t.headerTitle.appendChild(_t.parent.slides[0].title);_t.previous=Msn.PI.Util.GetNamedElement("a",_t.parent.footer,"left");_t.previous.setAttribute("id","prv");_t.previous.setAttribute("target","");_t.previous.tabIndex=0;_t.previous.innerText="< {0}".format(_t.parent.prevtext);_t.next=Msn.PI.Util.GetNamedElement("a",_t.parent.footer,"right");_t.next.setAttribute("id","prv");_t.next.setAttribute("target","");_t.next.tabIndex=0;_t.next.innerText="{0} >".format(_t.parent.nexttext);_t.bindEvent(_t.previous,"onclick",clickPrevious);_t.bindEvent(_t.previous,"onkeydown",clickPrevious);_t.bindEvent(_t.next,"onclick",clickNext);_t.bindEvent(_t.next,"onkeydown",clickNext);start();_t.loopInitValue=_t.showLoop;function clickPrevious(){window.event.cancelBubble=true;if(!window.event.keyCode&&Web.Browser.isMozilla()){window.event.keyCode=window.event.which;};if(window.event.type=="click"||(window.event.keyCode==13||window.event.keyCode==32)||(window.event.keyCode==0&&!window.event.shiftKey&&window.event.button!=2)){_t.go(-1);window.event.returnValue=false;if(window.event.preventDefault){window.event.preventDefault();};};};function clickNext(){window.event.cancelBubble=true;if(!window.event.keyCode&&Web.Browser.isMozilla()){window.event.keyCode=window.event.which;};if(window.event.type=="click"||(window.event.keyCode==13||window.event.keyCode==32)||(window.event.keyCode==0&&!window.event.shiftKey&&window.event.button!=2)){_t.go(1);window.event.returnValue=false;if(window.event.preventDefault){window.event.preventDefault();};};};};function start(){_t.showLoop=window.setTimeout(function(){_t.go(1);},_t.parent.speed);};this.dispose=function(_bUnld){for(var s=_t.parent.slides.length-1;s>=0;s--){_t.parent.slides[s].element.detachEvent("onmouseover",mouseOverSlide);_t.parent.slides[s].element.detachEvent("onmouseout",mouseOutSlide);_t.parent.slides[s].title=null;_t.parent.slides[s].element=null;_t.parent.slides[s]=null;};_t=_t.parent=_t.parent.slides=_t.showLoop=_t.loopInitValue=_t.previous=_t.next=_t.headerTitle=_el=_arg=_ns=null;Msn.PI.NC.Gadget.SlideControl.getBaseMethod(this,"dispose","Msn.PI.Gadget.Base").call(this,_bUnld);};this.go=function(iPos){if(_t.showLoop){window.clearTimeout(_t.showLoop);};if(!_t.parent.slides){return;};_t.oldPos=getShownPosition();_t.newPos=_t.oldPos+iPos;if(_t.oldPos+iPos<0){_t.newPos=_t.parent.slides.length-1;};if(_t.oldPos+iPos>_t.parent.slides.length-1){_t.newPos=0;};if(Web.Browser.isIE()){_t.parent.slides[_t.newPos].element.filters[0].apply();};Msn.PI.Util.AddClass(_t.parent.slides[_t.oldPos].element,"none");Msn.PI.Util.RemoveClass(_t.parent.slides[_t.newPos].element,"none");if(Web.Browser.isIE()){_t.parent.slides[_t.newPos].element.filters[0].play();};_t.headerTitle.removeChild(_t.headerTitle.firstChild);_t.headerTitle.appendChild(_t.parent.slides[_t.newPos].title);start();};function mouseOverSlide(){if(_t.showLoop!=_t.loopInitValue){if(Web.Browser.isIE()){if(_t.parent.slides[getShownPosition()].element.filters.length>0)_t.parent.slides[getShownPosition()].element.filters[0].stop();};window.clearTimeout(_t.showLoop);};};function mouseOutSlide(){if(_t.showLoop!=_t.loopInitValue){_t.showLoop=window.setTimeout(function(){_t.go(1);},_t.parent.speed);};};function getShownPosition(){var s;for(s=0;s<_t.parent.slides.length;s++){if(_t.parent.slides[s].element.className.indexOf("none")==-1){break;};};return s;};};Msn.PI.NC.Gadget.SlideControl.registerClass("Msn.PI.NC.Gadget.SlideControl","Msn.PI.Gadget.Base");registerNamespace("Msn.PI.NC.Module.Header");Msn.PI.NC.Module.Header=function(_el,_arg,_ns){Msn.PI.NC.Module.Header.initializeBase(this,arguments);var _t=this;_t.parent=null;_t.parentArgs=null;_t.iconContainer=null;this.initialize=function(_own){Msn.PI.NC.Module.Header.getBaseMethod(this,"initialize","Msn.PI.Module.Header").call(this,_own);};this.dispose=function(_bUnld){_t=_t.parent=_t.parentArgs=_t.iconContainer=_el=_arg=_ns=null;Msn.PI.NC.Module.Header.getBaseMethod(this,"dispose","Msn.PI.Module.Header").call(this,_bUnld);};this.render=function(_own){Msn.PI.NC.Module.Header.getBaseMethod(this,"render","Msn.PI.Module.Header").call(this,_own);};this.expanderCallback=function(_oBind,args){_oBind.setParentBinding(_oBind._objDeclaration.objScope.getBinding());if(Msn.PI.Util.ToBoolean(_t.parentArgs.isexpandable)){_t.bindEvent(_oBind,"ongadgetdown",function(){doHeaderClick(_oBind);});_t.bindEvent(_t._element,"onmousedown",function(){doHeaderClick(_oBind);});};function doHeaderClick(_oBind){window.event.cancelBubble=true;if(window.event.stopPropagation){window.event.stopPropagation();};var evtElement=Msn.PI.Util.GetEventElement("src",window.event);if(evtElement.tagName=="A"||(!Msn.PI.Util.ClassContains(evtElement,"Msn_PI_NC_Gadget_Expander")&&!Msn.PI.Util.ClassContains(evtElement,"Msn_PI_NC_Module_Header"))){window.event.returnValue=false;if(window.event.preventDefault){window.event.preventDefault();};return;};if(!window.event.keyCode&&Web.Browser.isMozilla()){window.event.keyCode=window.event.which;};if(window.event.type=="click"||window.event.type=="mousedown"||(window.event.keyCode==13||window.event.keyCode==32)||(window.event.keyCode==0&&!window.event.shiftKey&&window.event.button!=2)){_oBind.render();if(_t._element.nextSibling||(!_t._element.nextSibling&&_t._element.parentElement.nextSibling)){var contextElement=(_t._element.nextSibling)?_t._element:_t._element.parentElement;var sibling=contextElement.nextSibling;while(sibling){if(sibling.nodeType==1){Msn.PI.Util.ToggleClass(sibling,"none");}
else if(Msn.PI.Util.IsTextNode(sibling)&&sibling.length<=1&&(sibling.nodeValue==" "||"")){sibling.parentNode.removeChild(sibling);};sibling=sibling.nextSibling;};if(_t.parent.isPersisted){_t.parent.isOpen=!_t.parent.isOpen;if(contextElement.nextSibling.className.indexOf("none")==-1){contextElement.style.borderBottomWidth="";for(var g=0;g<_t.parent.boundGadgets.length;g++){_t.registerFor(_t.parent.boundGadgets[g].getType(),callback,_t.parent._element);};}
else{contextElement.style.borderBottomWidth="0px";};var stateValue="";for(var prop in _t.parent.moduleState){if(prop=="s"){stateValue+="s:{0},".format(_t.stateFlag[_t.parent.isOpen?"Open":"Closed"]);}
else{if(typeof _t.parent.moduleState[prop]=="string"){stateValue+="{0}:'{1}',".format(prop,_t.parent.moduleState[prop].replace(/'/g,"\\'"));}
else{stateValue+="{0}:{1},".format(prop,_t.parent.moduleState[prop]);};};};stateValue=stateValue.substring(0,stateValue.length-1);_t.parent.setState(eval("new Object({{0}})".format(stateValue)));};if(typeof _t.parent.render=="function"){_t.parent.render();};if(typeof _t.parent.headerClickExtra=="function"){_t.parent.headerClickExtra(_t);};};};};function callback(_oBind,_bState){if(_bState){if(_t.parent.isOpen&&_oBind._element.innerHTML==""&&typeof _oBind.render=="function"){_oBind.render();};};};};this.removeCallback=function(_oBind){if(Msn.PI.Util.ToBoolean(_t.parentArgs.isremoveable)){_t.bindEvent(_oBind,"ongadgetdown",function(){doRemoveClick(_oBind);});};function doRemoveClick(_oBind){if(!window.event.keyCode&&Web.Browser.isMozilla()){window.event.keyCode=window.event.which;};if(window.event.type.toLowerCase()=="click"||(window.event.keyCode==13||window.event.keyCode==32)||(window.event.keyCode==0&&!window.event.shiftKey&&window.event.button!=2)){_t.parent.setState({s:_t.stateFlag["Removed"]});_t.parent._element.parentElement.removeChild(_t.parent._element);window.event.cancelBubble=true;};if(typeof _t.parent.removeClickExtra=="function"){_t.parent.removeClickExtra(_t);};};};};Msn.PI.NC.Module.Header.registerClass("Msn.PI.NC.Module.Header","Msn.PI.Module.Header");Msn.PI.NC.Module.Header.Params=Web.Enum.create("addgadgets","persist","imgpath");registerNamespace("Msn.PI.NC.Module.Category");Msn.PI.NC.Module.Category=function(_el,_arg,_ns){Msn.PI.NC.Module.Category.initializeBase(this,arguments);var _t=this;_arg=_t.getParameters();_t.pid=_arg.pid;this.initialize=function(_own){Msn.PI.NC.Module.Category.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);if(!_t.isPersisted||(_t.isPersisted&&_t.moduleState.s!=Web.Conversion.coerceInt(_t.stateFlag["Removed"]))){_t.registerGadgets(_t._element);}
else if(_t.isPersisted&&_t.moduleState.s==Web.Conversion.coerceInt(_t.stateFlag["Removed"])){_t._element.parentElement.removeChild(_t._element);};};this.dispose=function(_bUnld){_t=_el=_arg=_ns=null;Msn.PI.NC.Module.Category.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};this.registerGadgetCallback=function(_oBind,_bState){if(_bState){_oBind.setParentBinding(_t);_t.boundGadgets.push(_oBind);if(!_oBind.responseObject){_t.bindEvent(_oBind,"onresponsecomplete",ResponseBound);}
else{ResponseBound(_oBind);};}
else{_t.boundGadgets.pop(_oBind);};};function ResponseBound(_oBind){if(typeof _oBind.Package!="undefined"){_oBind=_oBind.Package;};_t.response=_oBind.responseBinding.responseObject;if(!_t.response.hasError){_oBind.render(_t);}
else{_t._element.innerHTML=Msn.PI.Exception.ErrorMessage(_t.response.error,"xhtml");};};};Msn.PI.NC.Module.Category.registerClass("Msn.PI.NC.Module.Category","Msn.PI.Module.Base");Msn.PI.NC.Module.Category.Params=Web.Enum.create("bindgadgets","isexpandable","hascontext","isremoveable","resourceprefix","persist","pid");registerNamespace("Msn.PI.NC.Module.SlideShow");Msn.PI.NC.Module.SlideShow=function(_el,_arg,_ns){Msn.PI.NC.Module.SlideShow.initializeBase(this,arguments);var _t=this;_arg=_t.getParameters();_t.slides=new Array();_t.headerElement=_t.footer=null;_t.prevtext=_t.nexttext=_t.speed=null;this.initialize=function(_own){Msn.PI.NC.Module.SlideShow.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);_t.headerElement=_t._element.firstChild;if(Msn.PI.Util.IsTextNode(_t.headerElement.firstChild)){Msn.PI.Util.GetNamedElement("span",_t.headerElement,"","afterbegin").appendChild(_t.headerElement.removeChild(_t.headerElement.childNodes[1]));};var slides=Web.Dom.getElementsByCssSelector("div.parent",_t._element);var children=headline=abstr=imgparent=null;for(var i=0;i<slides.length;i++){Msn.PI.Util.AddClass(slides[i],"slide");var h3=Web.Dom.getElementsByCssSelector("H3",slides[i])[0];var slideElement=(typeof h3!="undefined")?slides[i].removeChild(h3).firstChild:document.createTextNode(_t.headerElement.innerText);var children=Web.Dom.getElementsByCssSelector("div",slides[i]);var imgparent=headline=abstr=source=null;var imgwidth=imgheight=0;if(children.length>0&&((children[0].innerHTML.length+children[1].innerHTML.length)>0)){slides[i].style.filter="progid:DXImageTransform.Microsoft.Fade(Duration=2,overlap=1.0)";_t.slides.push({title:slideElement,element:slides[i]});imgparent=Web.Dom.getElementsByCssSelector("div.linkedimg",slides[i]);if(imgparent.length!=0){imgwidth=Web.Conversion.coerceInt(imgparent[0].offsetWidth);imgheight=Web.Conversion.coerceInt(imgparent[0].offsetHeight);};headline=Web.Dom.getElementsByCssSelector("div.linkabs2 span",slides[i])[0];while(headline.childNodes.length>0)
{headline=headline.firstChild;}
abstr=Web.Dom.getElementsByCssSelector("div.linkabs2 p",slides[i])[0];source=Web.Dom.getElementsByCssSelector("div.abs span",slides[i])[0];if(slides.length>1){Msn.PI.Util.CropText.ByContainerWidthAndLines(headline,Web.Conversion.coerceInt(slides[i].offsetWidth)-imgwidth,2);Msn.PI.Util.CropText.ByContainerDimension(abstr,(typeof source!="undefined"&&imgheight>=(Web.Conversion.coerceInt(headline.offsetHeight)+Web.Conversion.coerceInt(source.offsetHeight)+Web.Conversion.coerceInt(abstr.offsetHeight)))?imgheight-(Web.Conversion.coerceInt(headline.offsetHeight)-Web.Conversion.coerceInt(source.offsetHeight)-Web.Conversion.coerceInt(abstr.offsetHeight)):75-Web.Conversion.coerceInt(headline.offsetHeight),1);};}
else{slides[i].parentElement.removeChild(slides[i]);};};slideElement=children=headline=abstr=source=imgparent=imgwidth=imgheight=null;_t.prevtext=_arg.prev;_t.nexttext=_arg.next;_t.speed=((typeof _arg.speed=="undefined"||!_arg.speed)?15:Web.Conversion.coerceInt(_arg.speed))*1000;render();};this.dispose=function(_bUnld){_t=_t.headerElement=_t.footer=_el=_arg=_ns=null;Msn.PI.NC.Module.SlideShow.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};function render(){if(_t.slides.length>1){_t.footer=Msn.PI.Util.GetNamedElement("h2",_t._element,"slider");_t.footer.setAttribute("id","catslideftr");_t.footer.setAttribute("{0}:id".format(_ns),_t.footer.id);_t.footer.setAttribute("{0}:persist".format(_ns),"false");Web.Bindings.attachElementBinding(_t.footer,"Msn.PI.NC.Gadget.SlideControl",_t,null,_ns,null,null,null,null);}
else if(_t.slides.length==1){_t.headerElement.removeChild(_t.headerElement.firstChild);_t.headerElement.appendChild(_t.slides[0].title);};};};Msn.PI.NC.Module.SlideShow.registerClass("Msn.PI.NC.Module.SlideShow","Msn.PI.Module.Base");Msn.PI.NC.Module.SlideShow.Params=Web.Enum.create("prev","next","speed");registerNamespace("Msn.PI.NC.Module.TabContainer");Msn.PI.NC.Module.TabContainer=function(_el,_arg,_ns){Msn.PI.NC.Module.TabContainer.initializeBase(this,arguments);var _t=this;_arg=_t.getParameters();_t.pid=_arg.pid;_t.tabs=new Array();_t.activeTab=null;_t.headerElement=_t.txtspan=_t.tabContainer=null;this.initialize=function(_own){Msn.PI.NC.Module.TabContainer.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);_t.headerElement=_t._element.firstChild;if(Msn.PI.Util.IsTextNode(_t.headerElement.firstChild)){Msn.PI.Util.GetNamedElement("span",_t.headerElement,"left","afterbegin").appendChild(_t.headerElement.removeChild(_t.headerElement.childNodes[1]));};_t.render();};this.dispose=function(_bUnld){_t=_t.headerElement=_t.txtspan=_t.tabContainer=_t.tabs=_el=_arg=_ns=null;Msn.PI.NC.Module.TabContainer.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};this.render=function(){var tabWidth=tabHeadings=tabContainerWidth=null;if(!_t.tabContainer){_t.tabContainer=document.createElement("ul");_t.tabContainer.style.zIndex=1;_t.tabContainer.className="linklist10 tabc";_t.headerElement.insertAdjacentElement("beforeend",_t.tabContainer);tabContainerWidth=(Web.Conversion.coerceInt(_t.headerElement.offsetWidth)-
Web.Conversion.coerceInt(_t.headerElement.currentStyle.paddingLeft.replace(/[a-zA-Z]/g,""))-
Web.Conversion.coerceInt(_t.headerElement.currentStyle.paddingRight.replace(/[a-zA-Z]/g,""))-
17)-
(Web.Conversion.coerceInt(_t.headerElement.firstChild.offsetLeft)+Web.Conversion.coerceInt(_t.headerElement.firstChild.offsetWidth));_t.tabContainer.width="{0}px".format(tabContainerWidth);tabHeadings=Web.Dom.getElementsByCssSelector("div.lngroup",_t._element);tabWidth=Web.Conversion.coerceInt(tabContainerWidth/tabHeadings.length);for(var i=0;i<tabHeadings.length;i++){var tab=Msn.PI.Util.GetNamedElement("li",_t.tabContainer,"tab");tab.id="th{0}".format(i);tab.tabIndex=0;var link=Msn.PI.Util.GetNamedElement("a",tab,"");tab.style.width="{0}px".format(tabWidth-
Web.Conversion.coerceInt(tab.currentStyle.paddingLeft.replace(/[a-zA-Z]/g,""))-
Web.Conversion.coerceInt(tab.currentStyle.paddingRight.replace(/[a-zA-Z]/g,""))-
Web.Conversion.coerceInt(tab.currentStyle.borderLeftWidth.replace(/[a-zA-Z]/g,""))-
Web.Conversion.coerceInt(tab.currentStyle.borderRightWidth.replace(/[a-zA-Z]/g,"")));_t.bindEvent(tab,"onclick",tabActivate);_t.bindEvent(tab,"onkeydown",tabActivate);if(i==tabHeadings.length-1){Msn.PI.Util.AddClass(tab,"last");};tabHeadings[i].id="tb{0}".format(i);var tabtitle=Web.Dom.getElementsByCssSelector(_arg.tabelement,tabHeadings[i]);if(tabtitle.length==0){tabtitle[0]=Msn.PI.Util.GetNamedElement("h3",tabHeadings[i],"","afterbegin");tabtitle[0].innerText=_t.headerElement.firstChild.innerText;};link.innerText=tab.title=tabtitle[0].innerText;tabtitle[0].tabIndex=0;Msn.PI.Util.AddClass(tabHeadings[i],"none");tab.setAttribute("tab",tabHeadings[i].id);tabHeadings[i].removeChild(tabtitle[0]);_t.tabs.push(tab);};};if(!_t.isOpen){Msn.PI.Util.AddClass(_t.tabContainer,"none");}
else{Msn.PI.Util.RemoveClass(_t.tabContainer,"none");_t.activeTab=(typeof _t.moduleState.th!="undefined"&&document.getElementById("th{0}".format(_t.moduleState.th)))?_t.moduleState.th:"0";Msn.PI.Util.RemoveClass(document.getElementById("tb{0}".format(_t.activeTab)),"none");Msn.PI.Util.AddClass(document.getElementById("th{0}".format(_t.activeTab)),"sel")};tabWidth=tabHeadings=null;};function tabActivate(evt){var evtElement=Msn.PI.Util.GetEventElement("src",evt);if(evtElement.tagName=="A"){evtElement=evtElement.parentElement;};window.event.cancelBubble=true;if(!evt.keyCode&&Web.Browser.isMozilla()){evt.keyCode=evt.which;};if(evt.type.toLowerCase()=="click"||evt.type.toLowerCase()=="keydown"&&((evt.keyCode==13||evt.keyCode==32)||(evt.keyCode==0&&!evt.shiftKey&&evt.button!=2))){Msn.PI.Util.RemoveClass(document.getElementById(evtElement.getAttribute("tab")),"none");Msn.PI.Util.AddClass(evtElement,"sel")
for(var t=0;t<_t.tabs.length;t++){if(_t.tabs[t].getAttribute("tab")!=evtElement.getAttribute("tab")){Msn.PI.Util.RemoveClass(_t.tabs[t],"sel");Msn.PI.Util.AddClass(document.getElementById(_t.tabs[t].getAttribute("tab")),"none");};};_t.moduleState.th=parseInt(evtElement.id.slice(2));window.event.returnValue=false;};};this.headerClickExtra=function(_oBind){for(var t=0;t<_t.tabs.length;t++){Msn.PI.Util.AddClass(document.getElementById(_t.tabs[t].getAttribute("tab")),"none");};Msn.PI.Util.RemoveClass(document.getElementById("th{0}".format(_t.activeTab)),"none");if(_t.isOpen){_t.render();}
else{Msn.PI.Util.AddClass(_t.tabContainer,"none");if(_oBind._element.style.borderBottomWidth!="0px"){_oBind._element.style.borderBottomWidth="0px";};};};};Msn.PI.NC.Module.TabContainer.registerClass("Msn.PI.NC.Module.TabContainer","Msn.PI.Module.Base");Msn.PI.NC.Module.TabContainer.Params=Web.Enum.create("isexpandable","hascontext","isremoveable","resourceprefix","persist","tabelement","pid");registerNamespace("Msn.PI.NC.Module.LatestNewsItemContainer");Msn.PI.NC.Module.LatestNewsItemContainer=function(_el,_arg,_ns){Msn.PI.NC.Module.LatestNewsItemContainer.initializeBase(this,arguments);var _t=this;_arg=_t.getParameters();_t.itemstate=(_arg.itemstate&&typeof _arg.itemstate!="undefined")?Web.Conversion.coerceInt(_arg.itemstate):1;_t.siblingBindings=new Array();this.initialize=function(_own){Msn.PI.NC.Module.LatestNewsItemContainer.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);_arg.persist=false;Msn.PI.Util.ExpireCookie(_t.getIdentity(),"/");var itemPosition=getItemPosition();_t.isOpen=(_t.itemstate==0||(_t.itemstate>-1&&itemPosition<=_t.itemstate))?true:false;if(_t._element.childNodes.length>0){_t.registerFor("Msn.PI.NC.Module.Header",headerCallback,Web.Dom.getElementsByCssSelector("div.link a",_t._element)[0]);_t.registerFor(_t.getType(),siblingCallback,_t._element.parentElement);};itemPosition=null;};function getItemPosition()
{if(!_t._element.previousSibling){return 1;}
else if(!_t._element.nextSibling){return _t._element.parentElement.childNodes.length;}
else{var counter=1;var sib=_t._element.previousSibling;while(sib){counter++;sib=sib.previousSibling;};sib=null;return counter;};};this.dispose=function(_bUnld){for(var i=0;i<_t.siblingBindings.length;i++){_t.siblingBindings.pop(_t.siblingBindings[i]);};_t.moduleState.s=(!_t._element.previousSibling)?_t.stateFlag["Open"]:_t.stateFlag["Closed"];_t.isPersisted=false;_t=_t.siblingBindings=_el=_arg=_ns=null;Msn.PI.NC.Module.LatestNewsItemContainer.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};function headerCallback(_oBind,_bState){_t.header=_oBind;if(_bState){if(window.opera){_t.header._element.attachEvent("onclick",function(evt){Msn.PI.Util.CancelEvent(evt);if(evt.srcElement.tagName=="A"){location.href=evt.srcElement.href;};});};if(!_t.isOpen){var sibling=_t.header._element.parentElement.nextSibling;while(sibling){Msn.PI.Util.AddClass(sibling,"none");sibling=sibling.nextSibling;};sibling=null;};}
else{};};function siblingCallback(_oBind,_bState){if(_bState){if(_t._element.getAttribute("{0}:id".format(_ns))!=_oBind._element.getAttribute("{0}:id".format(_ns))){_t.siblingBindings.push(_oBind);};};};};Msn.PI.NC.Module.LatestNewsItemContainer.registerClass("Msn.PI.NC.Module.LatestNewsItemContainer","Msn.PI.Module.Base");Msn.PI.NC.Module.LatestNewsItemContainer.Params=Web.Enum.create("isexpandable","hascontext","isremoveable","resourceprefix","persist","itemstate");registerNamespace("Msn.PI.NC.Module.SubscribeContainer");Msn.PI.NC.Module.SubscribeContainer=function(_el,_arg,_ns){Msn.PI.NC.Module.SubscribeContainer.initializeBase(this,arguments);var _t=this;_t.addFeedLinks=_t.form=_t.url=_t.subscontainer=_t.errorpanel=_t.subscription=null;_t.columns=new Array();_arg=_t.getParameters();_t.pid=_arg.pid;_t.fetchArgs=null;_t.linkcount=_t.cols=_t.maxfeeds=_t.dupfeederr=_t.maxfeederr=_t.invaliderr=_t.emptyerr=_t.feedurl=_t.localpath=null;_t.feedCount=0;_t.subscriptionBindings=new Array();this.initialize=function(_own){Msn.PI.NC.Module.SubscribeContainer.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);_t.registerFor("Msn.PI.NC.Module.Header",headerCallback,_t._element);_t.subscontainer=Msn.PI.Util.GetNamedElement("div",_t._element.firstChild.nextSibling,"subscon none","beforebegin");_t.errorpanel=Msn.PI.Util.GetNamedElement("div",_t._element.lastChild,"suberr none","beforebegin");_t.errorpanel.innerHTML="&nbsp;";_t.linkcount=Web.Conversion.coerceInt(_arg.linkcount);_t.cols=Web.Conversion.coerceInt(_arg.cols);_t.maxfeeds=Web.Conversion.coerceInt(_arg.maxfeeds);_t.localpath="{0}service.aspx".format(_arg.service);_t.form=Web.Dom.getElementsByCssSelector("div.child form",_t._element)[0];_t.form.removeAttribute("action");_t.form.removeAttribute("method");_t.addFeedLinks=Web.Dom.getElementsByCssSelector("div.c2 .feedlink",_t._element);for(var f=0;f<_t.addFeedLinks.length;f++){_t.bindEvent(_t.addFeedLinks[f],"onclick",function(evt){_t.url.value=Msn.PI.Util.GetEventElement("src",window.event).getAttribute("rss");formSubmit(evt);});};_t.registerFor("Msn.PI.NC.Module.Subscription",subscriptionCallback,_t.subscontainer);Msn.PI.Util.AddClass(_t.subscontainer,"none");_t.loadmessage=_arg.loadmsg;_t.dupfeederr=_arg.dupfeederr;_t.maxfeederr=_arg.maxfeederr;_t.invaliderr=_arg.invaliderr;_t.emptyerr=_arg.emptyerr;_t.url=Web.Dom.getElementsByCssSelector("input",_t.form)[0];_t.url.setAttribute("name",_t.url.id);_t.url.setAttribute("autocomplete","on");_t.url.setAttribute("initvalue",_t.url.value);_t.bindEvent(_t.url,"onfocus",function(){if(_t.errorpanel.innerHTML!="&nbsp;"){_t.showMessage("#999","");}
else{_t.url.value="";};});if(window.opera){Msn.PI.Util.SetSubmitButtonClick(_t,formSubmit);};_t.bindEvent(_t.form,"onsubmit",formSubmit);addPersistedSubscriptions();};this.dispose=function(_bUnld){if(_t.subscriptionBindings.length>0){_t.moduleState.b="";while(_t.subscriptionBindings.length>0){if(_t.subscriptionBindings[0].binding.moduleState.s!=Web.Conversion.coerceInt(_t.stateFlag["Removed"])){_t.moduleState.b+="i:\\'{0}\\',u:\\'{1}\\',s:{2}|".format(_t.subscriptionBindings[0].binding.getIdentity(),_t.subscriptionBindings[0].url,_t.stateFlag[_t.subscriptionBindings[0].binding.isOpen?"Open":"Closed"]);};_t.subscriptionBindings.remove(_t.subscriptionBindings[0]);};if(_t.moduleState.b.endsWith("|")){_t.moduleState.b=_t.moduleState.b.substring(0,_t.moduleState.b.length-1);}
else if(_t.moduleState.b.startsWith("|")){_t.moduleState.b=_t.moduleState.b.substring(1,_t.moduleState.b.length);};};_t=_t.form=_t.url=_t.subscontainer=_t.errorpanel=_t.subscription=_t.cols=_t.linkcount=_t.maxfeeds=_t.invaliderr=_t.emptyerr=_t.dupfeederr=_t.maxfeederr=_t.feedurl=_t.localpath=_el=_arg=_ns=null;Msn.PI.NC.Module.SubscribeContainer.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};function formSubmit(evt){Msn.PI.Util.CancelEvent(evt);_t.feedurl=_t.url.value;if(_t.feedurl!=""&&_t.feedurl!=_t.url.getAttribute("initvalue")){if(!_t.feedurl.toLowerCase().startsWith("http://")){_t.feedurl="http://{0}".format(_t.feedurl);};if((!window.event.shiftKey)&&(window.event.button!=2)){if(_t.maxfeeds==_t.feedCount){_t.showMessage("red","{0}".format(_t.maxfeederr.replace("{#do not remove this text#}",_t.maxfeeds)));}
else if(_t.getSubscriptionBinding(escape(_t.feedurl))){_t.showMessage("red",_t.dupfeederr);}
else{_t.showMessage("#999","");return addSubscription(_t.feedurl);};};};return false;};this.showMessage=function(color,message){Msn.PI.Util.RemoveClass(_t.errorpanel,"none");if(_t.errorpanel){_t.errorpanel.style.color=color;_t.errorpanel.innerHTML=message;_t.url.value=""};};function addSubscription(url){if(url.toLowerCase().substring(0,7)!="http://"){url="http://{0}".format(url);};_t.showMessage("#999",_t.loadmessage);_t.subscription=Msn.PI.Util.GetNamedElement("div",_t.subscontainer,"sub","beforeEnd");_t.subscription.setAttribute("{0}:url".format(_ns),url);Web.Bindings.extendBinding(_t.subscription,_t);_t.feedCount++;return false;};function addPersistedSubscriptions(){if(typeof _t.moduleState.b!="undefined"&&_t.moduleState.b!=null){var subsArray=_t.moduleState.b.split("|");for(var i=0;i<subsArray.length;i++){if(subsArray[i]!=""){if(subsArray[i].endsWith("''")){subsArray[i]=subsArray[i].substring(0,subsArray[i].length-1);};addSubscription(eval("new Object({{0}})".format(subsArray[i])).u.decodeURI());};};};};function headerCallback(_oBind,_bState){if(_bState){_t.header=_oBind;if(window.opera){_t.header._element.attachEvent("onclick",Msn.PI.Util.CancelEvent);};_t.headerClickExtra(_oBind);}
else{if(window.opera){_t.header._element.detachEvent("onclick",Msn.PI.Util.CancelEvent);};};};function subscriptionCallback(_oBind,_bState){if(_bState){_oBind.fetch(_t);_t.subscriptionBindings.push(new Object({url:escape(_oBind.url),binding:_oBind}));};};this.getSubscriptionBinding=function(url){if(typeof _t.subscriptionBindings!="undefined"&&_t.subscriptionBindings!=null){for(var s=0;s<_t.subscriptionBindings.length;s++){if(_t.subscriptionBindings[s].url.toLowerCase()==url.toLowerCase()){return _t.subscriptionBindings[s];};};};return null;};this.getPersistedSubscriptionState=function(url){if(typeof _t.moduleState.b!="undefined"&&_t.moduleState.b!=null&&_t.moduleState.b!="|"){var subsArray=_t.moduleState.b.split("|");for(var i=0;i<subsArray.length;i++){if(subsArray[i]!=""){if(subsArray[i].endsWith("''")){subsArray[i]=subsArray[i].substring(0,subsArray[i].length-1);};if(eval("new Object({{0}})".format(subsArray[i])).u.decodeURI()==url){return eval("new Object({{0}})".format(subsArray[i]));};};};};return null;};this.headerClickExtra=function(_oBind){if(_t.isOpen){if(typeof _t.moduleState.b!="undefined"&&_t.moduleState.b!=null){_oBind._element.style.marginBottom="";_t._element.style.paddingBottom="";};if(_t.feedCount==0){Msn.PI.Util.AddClass(_t.subscontainer,"none");};if(_t.errorpanel.innerHTML==""){Msn.PI.Util.AddClass(_t.errorpanel,"none");};}
else{Msn.PI.Util.AddClass(_t.errorpanel,"none");Msn.PI.Util.AddClass(_t.subscontainer,"none");if(_oBind._element.style.borderBottomWidth!="0px"){_oBind._element.style.borderBottomWidth="0px";};_oBind._element.style.marginBottom="0";_t._element.style.paddingBottom="0";};};};Msn.PI.NC.Module.SubscribeContainer.registerClass("Msn.PI.NC.Module.SubscribeContainer","Msn.PI.Module.Base");Msn.PI.NC.Module.SubscribeContainer.Params=Web.Enum.create("isexpandable","hascontext","isremoveable","resourceprefix","persist","pid","linkcount","cols","maxfeeds","loadmsg","dupfeederr","maxfeederr","invaliderr","emptyerr","service");registerNamespace("Msn.PI.NC.Module.Subscription");Msn.PI.NC.Module.Subscription=function(_el,_arg,_ns){Msn.PI.NC.Module.Subscription.initializeBase(this,arguments);var _t=this;_t.headerText=_t.headerElement=_t.list=null;_t.response=null;_arg=_t.getParameters();_t.pid=_arg.pid;_t.url=_el.removeAttributeNode(_el.getAttributeNode("{0}:url".format(_ns))).nodeValue;_t.parent=null;_t.position=null;_t.localpath=null;this.initialize=function(_own){Msn.PI.NC.Module.Subscription.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);_t.registerFor("Msn.PI.NC.Module.Header",headerCallback,_t._element);var persistedState=_t.parent.getPersistedSubscriptionState(_t.url);if(persistedState&&persistedState.s==Web.Conversion.coerceInt(_t.stateFlag["Closed"])){_t.isOpen=false
_t.moduleState.s=_t.stateFlag["Closed"];persistedState=null;}
else{_t.isOpen=true;_t.moduleState.s=_t.stateFlag["Open"];};_t.position=getChildNumber();};this.dispose=function(_bUnld){_t.isPersisted=false;_t=_t.headerText=_t.headerElement=_t.response=_t.list=_t.url=_el=_arg=_ns=null;Msn.PI.NC.Module.Subscription.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};this.fetch=function(parent){_t.parent=parent;_t.localpath="{0}?returnheadlines={1}&fetchurl=".format(_t.parent.localpath,_t.parent.linkcount,_t.url);Web.Bindings.attachElementBinding(_t._element,"Msn.PI.Response.Request",_t,{type:Web.Network.Type.XML,feedurl:_t.url,localpath:_t.localpath,storycount:_t.parent.linkcount,parse:true},_ns,rssCallback,null,null,null);};function rssCallback(_oBind){if(!_oBind.responseObject){_t.bindEvent(_oBind,"onresponsecomplete",responseBound);}
else{responseBound(_oBind);};};function responseBound(_oBind){if(typeof _oBind.Package!="undefined"){_oBind=_oBind.Package;};_t.response=_oBind.responseObject;if(_t.response.hasError||typeof _t.response.rss=="undefined"){_t.parent.showMessage("red",_t.parent.invaliderr);_t.removeClickExtra(_t);return;}
else{_t.build();};};function getChildNumber(){if(!_t._element.previousSibling){return 1;}
else if(!_t._element.nextSibling){return _t.parent.subscontainer.childNodes.length;}
else{var num=null;for(var s=1;s<_t.parent.subscontainer.childNodes.length-1;s++){if(_t.parent.subscontainer.childNodes[s].getAttribute("{0}:id".format(_ns))==_t._element.getAttribute("{0}:id".format(_ns))){num=s+1;break;};};return num;};};this.build=function(){Msn.PI.Util.RemoveClass(_t.parent.subscontainer,"none");if(_t.position%_t.parent.cols>0){_t._element.style.clear="both";_t._element.style.paddingRight=".5ex";}
else{_t._element.style.paddingLeft=".5ex";};_t.headerElement=Msn.PI.Util.GetNamedElement("a",_t._element,"myhdr");_t.headerElement.innerText=(_t.response.rss.channel.title.length==1)?_t.response.rss.channel.title.text:_t.response.rss.channel.title[0].text;if(Msn.PI.Util.GetEscapedValue(_t.response.rss.channel.link.text)!=""){_t.headerElement.href=_t.response.rss.channel.link.text;};_t.list=Msn.PI.Util.GetNamedElement("ul",_t._element,"linklist16");var item=items=listItem=listItemLink=null;if(_t.response.rss.channel.item&&_t.response.rss.channel.item.length>0){items=_t.response.rss.channel.item;for(var c=0;c<items.length;c++){listItem=Msn.PI.Util.GetNamedElement("li",_t.list,(c==0)?"first":(c==items.length-1)?"last":"");listItemLink=Msn.PI.Util.GetNamedElement("a",listItem,"");item=(typeof items[c]!="undefined")?items[c]:items;listItemLink.href=item.link.text;listItemLink.innerText=Msn.PI.Util.ParseHTML(item.title.text).text;if(typeof item.description!="undefined"){listItemLink.title=Msn.PI.Util.ParseHTML(item.description.text).text;};};};items=item=listItem=listItemLink=null;_t.parent.showMessage("#999","");Web.Bindings.extendBinding(_t.headerElement,_t.parent);_t._element.style.width="{0}ex".format((Web.Conversion.coerceInt(_t.parent._element.offsetWidth/6)/_t.parent.cols)-
Web.Conversion.coerceInt(_t._element.currentStyle.paddingLeft.replace(/[A-za-z]/g,""))-
Web.Conversion.coerceInt(_t._element.currentStyle.paddingRight.replace(/[A-za-z]/g,"")));};function headerCallback(_oBind,_bState){if(_bState){_t.bindEvent(_oBind,"onrendercomplete",headerRenderBound);};};function headerRenderBound(_oBind){_t.headerText=Msn.PI.Util.GetNamedElement("span",((typeof _oBind.Package!="undefined")?_oBind.Package._element:_oBind._element),"rsstitle","beforeend");if(window.opera){_t.headerText.attachEvent("onclick",function(evt){Msn.PI.Util.CancelEvent(evt);if(evt.srcElement.tagName=="SPAN"){location.href=evt.srcElement.parentElement.parentElement.href;};});};_t.headerText.innerText=(_t.response.rss.channel.title.length==1)?_t.response.rss.channel.title.text:_t.response.rss.channel.title[0].text;if(_t.headerText.previousSibling&&Msn.PI.Util.IsTextNode(_t.headerText.previousSibling)){_t.headerText.parentNode.removeChild(_t.headerText.previousSibling);};};this.render=function(){if(!_t.isOpen){Msn.PI.Util.AddClass(_t.list,"none");}
else{Msn.PI.Util.RemoveClass(_t.list,"none");};};this.removeClickExtra=function(_oBind){if(_t._element.parentElement){_t._element.parentElement.removeChild(_t._element);};if(typeof _t.parent.moduleState.b!="undefined"&&_t.parent.moduleState.b!=null){_t.parent.moduleState.b=_t.parent.moduleState.b.replace("i:\'{0}\',u:\'{1}\',s:{2}".format(_t.getIdentity(),escape(_t.url),_t.stateFlag["Open"]),"").replace("i:\'{0}\',u:\'{1}\',s:{2}".format(_t.getIdentity(),escape(_t.url),_t.stateFlag["Closed"]),"").replace("i:\'{0}\',u:\'{1}\',s:{2}".format(_t.getIdentity(),escape(_t.url),_t.stateFlag["Removed"]),"");_t.parent.moduleState.b=_t.parent.moduleState.b.replace(/^\||\|$/,"|").replace(/\|\|/g,"|");};if(typeof _t.parent.subscriptionBindings!="undefined"&&_t.parent.subscriptionBindings!=null){_t.parent.subscriptionBindings.remove(_t.parent.getSubscriptionBinding(escape(_t.url)));};_t.parent.feedCount--;if(_t.parent.feedCount==0){Msn.PI.Util.AddClass(_t.parent.subscontainer,"none");};};};Msn.PI.NC.Module.Subscription.registerClass("Msn.PI.NC.Module.Subscription","Msn.PI.Module.Base");Msn.PI.NC.Module.Subscription.Params=Web.Enum.create("isexpandable","hascontext","isremoveable","resourceprefix","persist","pid");registerNamespace("Msn.PI.NC.Module.WeatherContainer");Msn.PI.NC.Module.WeatherContainer=function(_el,_arg,_ns){Msn.PI.NC.Module.WeatherContainer.initializeBase(this,arguments);var _t=this;_t.form=_t.locationfield=_t.wtrcontainer=_t.formContainer=_t.searchcontainer=_t.searchpanel=_t.searchclose=_t.errorpanel=null;_t.columns=new Array();_arg=_t.getParameters();_t.pid=_arg.pid;_t.defaultcity=_t.tempformat=_t.culture=_t.linkcount=_t.cols=_t.maxfeeds=_t.dupfeederr=_t.maxfeederr=_t.invaliderr=_t.emptyerr=_t.localpath=null;_t.searchresponse=null;_t.feedCount=0;_t.forecastBindings=new Array();_t.locCodeRegEx=new RegExp("").compile("[a-zA-Z]{2,}:[a-zA-Z0-9]+","i");_t.imgpath=null;this.initialize=function(_own){Msn.PI.NC.Module.WeatherContainer.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);_t.registerFor("Msn.PI.NC.Module.Header",headerCallback,_t._element);_t.wtrcontainer=Msn.PI.Util.GetNamedElement("div",_t._element.firstChild.nextSibling,"wtrcon none","beforebegin");_t.errorpanel=Msn.PI.Util.GetNamedElement("div",_t._element.lastChild,"wtrerr none","beforebegin");_t.errorpanel.innerHTML="&nbsp;";_t.linkcount=Web.Conversion.coerceInt(_arg.linkcount);_t.maxfeeds=Web.Conversion.coerceInt(_arg.maxfeeds);_t.localpath="{0}service.aspx".format(_arg.service);_t.imgpath=_arg.imgpath;_t.loadmessage=_arg.loadmsg;_t.dupfeederr=_arg.dupfeederr;_t.maxfeederr=_arg.maxfeederr;_t.invaliderr=_arg.invaliderr;_t.emptyerr=_arg.emptyerr;_t.defaultcity=_arg.defaultcity;_t.tempformat=_arg.tempformat;_t.culture=_arg.culture;_t.closetext=_arg.closetext;_t.formContainer=Web.Dom.getElementsByCssSelector("div.child",_t._element)[0];if(_t.isOpen){_t.formContainer.style.display="block";};_t.form=Web.Dom.getElementsByCssSelector("form",_t.formContainer)[0];_t.form.removeAttribute("action");_t.form.removeAttribute("method");_t.searchcontainer=Web.Dom.getElementsByCssSelector("div.child div.abs",_t._element)[0];if(_t.isOpen){_t.searchcontainer.parentElement.style.display="block";};Msn.PI.Util.AddClass(_t.wtrcontainer,"none");_t.locationfield=Web.Dom.getElementsByCssSelector("input",_t.form)[0];_t.locationfield.setAttribute("name",_t.locationfield.id);_t.locationfield.setAttribute("autocomplete","on");_t.locationfield.setAttribute("initvalue",_t.locationfield.value);_t.bindEvent(_t.locationfield,"onfocus",function(){if(_t.errorpanel.innerHTML!="&nbsp;"){_t.showMessage("#999","");}
else{_t.locationfield.value="";};});if(window.opera){Msn.PI.Util.SetSubmitButtonClick(_t,formSubmit);};_t.bindEvent(_t.form,"onsubmit",formSubmit);addPersistedForecasts();};this.dispose=function(_bUnld){if(_t.forecastBindings.length>0){_t.moduleState.b="";while(_t.forecastBindings.length>0){if(_t.forecastBindings[0].moduleState.s!=Web.Conversion.coerceInt(_t.stateFlag["Removed"])){_t.moduleState.b+="l:\\'{0}\\',s:{1}|".format(_t.forecastBindings[0].location.replace(/\r/g,''),_t.stateFlag[_t.forecastBindings[0].isOpen?"Open":"Closed"]);};_t.forecastBindings.remove(_t.forecastBindings[0]);};if(_t.moduleState.b.endsWith("|")){_t.moduleState.b=_t.moduleState.b.substring(0,_t.moduleState.b.length-1);}
else if(_t.moduleState.b.startsWith("|")){_t.moduleState.b=_t.moduleState.b.substring(1,_t.moduleState.b.length);};};_t=_t.locCodeRegEx=_t.searchresponse=_t.imgpath=_t.form=_t.locationfield=_t.wtrcontainer=_t.formContainer=_t.searchcontainer=_t.searchpanel=_t.searchclose=_t.errorpanel=_t.defaultcity=_t.tempformat=_t.culture=_t.cols=_t.linkcount=_t.maxfeeds=_t.invaliderr=_t.emptyerr=_t.dupfeederr=_t.maxfeederr=_t.localpath=_el=_arg=_ns=null;Msn.PI.NC.Module.WeatherContainer.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};function formSubmit(evt){Msn.PI.Util.CancelEvent(evt);var locationValue=_t.locationfield.value;if(locationValue!=""&&locationValue!=_t.locationfield.getAttribute("initvalue")){if((!window.event.shiftKey)&&(window.event.button!=2)){if(_t.maxfeeds>0&&_t.maxfeeds==_t.feedCount){_t.showMessage("red","{0}".format(_t.maxfeederr.replace("{#do not remove this text#}",_t.maxfeeds)));}
else if(_t.getBoundForecast(locationValue)){_t.showMessage("red",_t.dupfeederr);}
else{_t.showMessage("#999","");if(!_t.locCodeRegEx.test(locationValue)){return getForecast(locationValue,true);}
else{return getForecast(locationValue,false);};};};};locationValue=null;return false;};this.showMessage=function(color,message){if(_t.isOpen){Msn.PI.Util.RemoveClass(_t.errorpanel,"none");};if(_t.errorpanel){_t.errorpanel.style.color=color;_t.errorpanel.innerHTML=message;_t.locationfield.value="";};};function getForecast(loc,search){_t.showMessage("#999",_t.loadmessage);Web.Bindings.attachElementBinding(_t._element,"Msn.PI.Response.Request",_t,{type:Web.Network.Type.XML,feedurl:"{0}&rand={1}".format((search)?"?weasearchstr={0}&weadegreetype={1}&culture={2}".format(encodeURI(loc),_t.tempformat.toUpperCase(),_t.culture):"?wealocations={0}&weadegreetype={1}&culture={2}".format(loc.replace("|","\\r"),_t.tempformat.toUpperCase(),_t.culture),Math.random()),localpath:_t.localpath,storycount:null,escape:false,parse:true},_ns,fetchCallback,null,null,null);return false;};function headerCallback(_oBind,_bState){if(_bState){_t.header=_oBind;};};function fetchCallback(_oBind){if(!_oBind.responseObject){_t.bindEvent(_oBind,"onresponsecomplete",responseBound);}
else{responseBound(_oBind);};};function responseBound(_oBind){if(typeof _oBind.Package!="undefined"){_oBind=_oBind.Package;};var response=_oBind.responseObject;if(response.hasError||!response.weatherdata||!response.weatherdata.weather){_t.showMessage("red",_t.invaliderr);}
else{var locations=_oBind.url.replace(/\r/g,'');if(_t.searchresponse!=null){closeSearch();};if(locations.indexOf("?weasearchstr=")>-1&&response.weatherdata.weather.length>1){_t.searchresponse=response;_t.searchpanel=Msn.PI.Util.GetNamedElement("div",_t.searchcontainer,"wtrsrch","afterEnd");Msn.PI.Util.ToggleClass(_t.searchcontainer,"show");Msn.PI.Util.ToggleClass(_t.searchpanel,"show");var searchResult=null;for(var c=0;c<_t.searchresponse.weatherdata.weather.length;c++){searchResult=Msn.PI.Util.GetNamedElement("a",Msn.PI.Util.GetNamedElement("div",_t.searchpanel,"wtrsrres"),"","beforeEnd");searchResult.href="#";searchResult.innerText=_t.searchresponse.weatherdata.weather[c].attributes["weatherlocationname"];searchResult.setAttribute("nc:value",_t.searchresponse.weatherdata.weather[c].attributes["weatherlocationcode"]);searchResult.setAttribute("nc:position",c);searchResult.attachEvent("onclick",resultClick);searchResult.attachEvent("onmousedown",resultClick);};searchResult=null;_t.errorpanel.innerHTML="&nbsp";_t.searchclose=Msn.PI.Util.GetNamedElement("a",Msn.PI.Util.GetNamedElement("div",_t.searchpanel,"wtrsrcls","beforeEnd"),"wtrsrcls");_t.searchclose.innerText=_t.closetext;_t.searchclose.href="#";_t.searchclose.attachEvent("onclick",closeClick);}
else{var weatherdata=response.weatherdata.weather;var weathernode=null;locations=_oBind.url.replace((locations.indexOf("?weasearchstr=")>-1?"?weasearchstr=":"?wealocations="),"");locations=locations.substring(0,locations.indexOf("&weadegreetype="));if(locations.indexOf(":")==locations.lastIndexOf(":")){if(!_t.locCodeRegEx.test(locations)){getForecastBinding(response.weatherdata.weather.attributes["weatherlocationcode"],response.weatherdata.weather);}
else{getForecastBinding(locations,response.weatherdata.weather);};}
else{locations=locations.split("\\r");for(var f=0;f<locations.length;f++){for(var c=0;c<weatherdata.length;c++){if(weatherdata[c].attributes["weatherlocationcode"]==locations[f]){weathernode=weatherdata[c];break;};};getForecastBinding(locations[f],weathernode);};};weatherdata=weathernode=null;};locations=null;};_oBind.dispose(false);_oBind=response=null;return;};function resultClick(evt){Msn.PI.Util.CancelEvent(evt);var evtElement=Msn.PI.Util.GetEventElement("src",evt);if(evt.type.toLowerCase()=="click"||evt.type.toLowerCase()=="keydown"&&((evt.keyCode==13||evt.keyCode==32)||(evt.keyCode==0&&!evt.shiftKey&&evt.button!=2))){getForecastBinding(evtElement.getAttribute("nc:value"),_t.searchresponse.weatherdata.weather[evtElement.getAttribute("nc:position")]);closeSearch();};return false;};function closeClick(evt){Msn.PI.Util.CancelEvent(evt);var evtElement=Msn.PI.Util.GetEventElement("src",evt);if(evt.type.toLowerCase()=="click"||evt.type.toLowerCase()=="keydown"&&((evt.keyCode==13||evt.keyCode==32)||(evt.keyCode==0&&!evt.shiftKey&&evt.button!=2))){closeSearch();};return false;};function closeSearch(){while(_t.searchpanel.hasChildNodes()){_t.searchpanel.removeChild(_t.searchpanel.lastChild);};Msn.PI.Util.ToggleClass(_t.searchpanel,"show");Msn.PI.Util.ToggleClass(_t.searchpanel,"none");Msn.PI.Util.ToggleClass(_t.searchcontainer,"show");Msn.PI.Util.ToggleClass(_t.searchcontainer,"none");_t.errorpanel.innerHTML="&nbsp";_t.searchpanel=null;_t.searchresponse=null;};function getForecastBinding(location,node){Web.Bindings.attachElementBinding(addForecastElement(),"Msn.PI.NC.Module.WeatherForecast",_t,{location:location,response:node,isexpandable:true,hascontext:false,isremoveable:true,resourceprefix:'category',persist:true},_ns,forecastCallback,null,null,null);};function forecastCallback(_oBind,_bState){if(_bState||typeof _bState=="undefined"){_t.forecastBindings.push(_oBind);_oBind.build();_oBind.render();};};function addForecastElement(){_t.showMessage("#999",_t.loadmessage);_t.feedCount++;return Msn.PI.Util.GetNamedElement("div",_t.wtrcontainer,"wtr","beforeEnd");};function addPersistedForecasts(){if(typeof _t.moduleState.b!="undefined"&&_t.moduleState.b!=null&&_t.moduleState.b!="|"&&_t.moduleState.b!=""){var fcArray=_t.moduleState.b.split("|");var codes="";var persistedloc=null;for(var c=0;c<fcArray.length;c++){if(fcArray[c]!=""){if(fcArray[c].endsWith("''")){fcArray[c]=fcArray[c].substring(0,fcArray[c].length-1);};persistedloc=eval("new Object({{0}})".format(fcArray[c]));codes+="{0}{1}".format(persistedloc.l,(c<fcArray.length-1)?"\\r":"");};};getForecast(codes,false);codes=persistedloc=fcArray=null;}
else{getForecast(_t.defaultcity,false);};};this.getBoundForecast=function(loc){if(typeof _t.forecastBindings!="undefined"&&_t.forecastBindings!=null){for(var s=0;s<_t.forecastBindings.length;s++){if(_t.forecastBindings[s].location==loc){return _t.forecastBindings[s];};};};return null;};this.getPersistedForecastState=function(loc){if(typeof _t.moduleState.b!="undefined"&&_t.moduleState.b!=null&&_t.moduleState.b!="|"&&_t.moduleState.b!=""){var fcArray=_t.moduleState.b.split("|");for(var i=0;i<fcArray.length;i++){if(fcArray[i]!=""){if(fcArray[i].endsWith("''")){fcArray[i]=fcArray[i].substring(0,fcArray[i].length-1);};if(eval("new Object({{0}})".format(fcArray[i])).l==loc){return eval("new Object({{0}})".format(fcArray[i]));};};};};return null;};this.headerClickExtra=function(_oBind){if(_t.isOpen){if(typeof _t.moduleState.b!="undefined"&&_t.moduleState.b!=null){_oBind._element.style.marginBottom="";_t._element.style.paddingBottom="";};if(_t.feedCount==0){Msn.PI.Util.AddClass(_t.wtrcontainer,"none");};if(_t.errorpanel.innerHTML==""){Msn.PI.Util.AddClass(_t.errorpanel,"none");};}
else{_t.formContainer.style.display="block";Msn.PI.Util.AddClass(_t.errorpanel,"none");Msn.PI.Util.AddClass(_t.wtrcontainer,"none");if(_oBind._element.style.borderBottomWidth!="0px"){_oBind._element.style.borderBottomWidth="0px";};_oBind._element.style.marginBottom="0";_t._element.style.paddingBottom="0";};};};Msn.PI.NC.Module.WeatherContainer.registerClass("Msn.PI.NC.Module.WeatherContainer","Msn.PI.Module.Base");Msn.PI.NC.Module.WeatherContainer.Params=Web.Enum.create("isexpandable","hascontext","isremoveable","resourceprefix","persist","pid","defaultcity","tempformat","closetext","culture","cols","maxfeeds","loadmsg","dupfeederr","maxfeederr","invaliderr","emptyerr","service","imgpath");registerNamespace("Msn.PI.NC.Module.WeatherForecast");Msn.PI.NC.Module.WeatherForecast=function(_el,_arg,_ns){Msn.PI.NC.Module.WeatherForecast.initializeBase(this,arguments);var _t=this;_t.headerText=_t.headerElement=_t.list=null;_arg=_t.getParameters();_t.location=null;_t.response=null;_t.position=null;this.initialize=function(_own){Msn.PI.NC.Module.WeatherForecast.getBaseMethod(this,"initialize","Msn.PI.Module.Base").call(this,_own);_t.location=_arg.location.replace(/\r/g,'');_t.response=_arg.response;_t.parent=_own.getBinding();_t.registerFor("Msn.PI.NC.Module.Header",headerCallback,_t._element);var persistedState=_t.parent.getPersistedForecastState(_t.location);if(persistedState&&persistedState.s==Web.Conversion.coerceInt(_t.stateFlag["Closed"])){_t.isOpen=false
_t.moduleState.s=_t.stateFlag["Closed"];persistedState=null;}
else{_t.isOpen=true;_t.moduleState.s=_t.stateFlag["Open"];};_t.position=getChildNumber();};this.dispose=function(_bUnld){_t.isPersisted=false;_t=_t.headerText=_t.headerElement=_t.response=_t.list=_el=_arg=_ns=null;Msn.PI.NC.Module.WeatherForecast.getBaseMethod(this,"dispose","Msn.PI.Module.Base").call(this,_bUnld);};function getChildNumber(){if(!_t._element.previousSibling){return 1;}
else if(!_t._element.nextSibling){return _t.parent.wtrcontainer.childNodes.length;}
else{var num=null;for(var s=1;s<_t.parent.wtrcontainer.childNodes.length-1;s++){if(_t.parent.wtrcontainer.childNodes[s].getAttribute("{0}:id".format(_ns))==_t._element.getAttribute("{0}:id".format(_ns))){num=s+1;break;};};return num;};};this.build=function(){if(_t.parent.isOpen){Msn.PI.Util.RemoveClass(_t.parent.wtrcontainer,"none");};_t.headerElement=Msn.PI.Util.GetNamedElement("a",_t._element,"wtrhdr{0}".format(_t.position==1?" first":""));_t.headerElement.appendChild(document.createTextNode(" "));if(Msn.PI.Util.GetEscapedValue(_t.response.attributes["weatherlocationname"])!=""){_t.headerElement.href=_t.response.attributes["url"];_t.headerElement.innerText="{0}    {1}{2}{3}    {4}".format(_t.response.attributes["weatherlocationname"],_t.response.current.attributes["temperature"],"\xB0",_t.response.attributes["degreetype"].toLowerCase(),_t.response.current.attributes["skytext"]);};_t.list=Msn.PI.Util.GetNamedElement("ul",_t._element,"wtrlist");var item=items=listItem=listItemLink=null;if(_t.response.forecast&&_t.response.forecast.length>0){items=_t.response.forecast;var i,day,div,el,imgsrc;for(var c=0;c<items.length;c++){listItem=Msn.PI.Util.GetNamedElement("li",_t.list,(c==0)?"first":(c==items.length-1)?"last":"");div=Msn.PI.Util.GetNamedElement("div",listItem,"wtrdays");el=Msn.PI.Util.GetNamedElement("div",div,"wtrday");el.innerText=items[c].attributes["day"];img=Msn.PI.Util.GetNamedElement("img",div,"");img.alt=items[c].attributes["skytextday"];img.setAttribute("width","35");img.setAttribute("height","21");img.src="{0}{1}.gif".format(_t.response.attributes["imagerelativeurl"],items[c].attributes["skycodeday"]);el=Msn.PI.Util.GetNamedElement("div",div,"wtrtmp");el.innerHTML=isNaN(items[c].attributes["high"])?"- / {0}&deg;".format(items[c].attributes["low"]):"{0}&deg; / {1}&deg;".format(items[c].attributes["high"],items[c].attributes["low"]);};i=day=div=imgsrc=null;};items=item=listItem=listItemLink=null;_t.parent.showMessage("#999","");Web.Bindings.attachElementBinding(_t.headerElement,"Msn.PI.NC.Module.Header",_t,{addgadgets:'{selector:\'img.marrimg\', type:\'Msn.PI.NC.Gadget.Expander\', callback: _t.expanderCallback}|{selector:\'img.mrmvimg\', type:\'Msn.PI.NC.Gadget.Remover\', callback: _t.removeCallback}',persist:false,imgpath:_t.parent.imgpath},_ns,headerCallback,null,null,null);};function headerCallback(_oBind,_bState){_oBind.render(_t);if(window.opera){_oBind._element.firstChild.attachEvent("onclick",Msn.PI.Util.CancelEvent);};};this.render=function(){if(!_t.isOpen){Msn.PI.Util.AddClass(_t.list,"none");}
else{Msn.PI.Util.RemoveClass(_t.list,"none");};};this.removeClickExtra=function(_oBind){if(_t._element.parentElement){_t._element.parentElement.removeChild(_t._element);};if(typeof _t.parent.moduleState.b!="undefined"&&_t.parent.moduleState.b!=null){_t.parent.moduleState.b=_t.parent.moduleState.b.replace("l:\'{0}\',s:{1}".format(_t.location,_t.stateFlag["Open"]),"").replace("l:\'{0}\',s:{1}".format(_t.location,_t.stateFlag["Closed"]),"").replace("l:\'{0}\',s:{1}".format(_t.location,_t.stateFlag["Removed"]),"");_t.parent.moduleState.b=_t.parent.moduleState.b.replace(/^\||\|$/,"|").replace(/\|\|/g,"|");};if(typeof _t.parent.forecastBindings!="undefined"&&_t.parent.forecastBindings!=null){_t.parent.forecastBindings.remove(_t.parent.getBoundForecast(_t.location));};_t.parent.feedCount--;if(_t.parent.feedCount==0){Msn.PI.Util.AddClass(_t.parent.wtrcontainer,"none");};};};Msn.PI.NC.Module.WeatherForecast.registerClass("Msn.PI.NC.Module.WeatherForecast","Msn.PI.Module.Base");Msn.PI.NC.Module.WeatherForecast.Params=Web.Enum.create("isexpandable","hascontext","isremoveable","resourceprefix","persist","response","location");