(function(){var h=this,b=Msn.DOM,g=b.ParentElem,a=Msn.My.AjaxHelper,d=Msn.My.Tracking,e=Msn.My.Utility,c=false,i=b.Target,f=b.CancelEvent,j=b.Event;h.Selector=function(h){var b=null;function m(l){var d=j(l),a=i(d);if(b=="addtomymsncancel"){var h=a.getAttribute("returnUrl");r(h)}if(b=="addtomymsnokbtn"){var g=mType,c=a.getAttribute("omnitureId");p(g,c)}else if(b=="addtomymsnokbtnrss"){var k=rssUrl,e=a.getAttribute("omnitureId");o(k,e)}else if(b=="addtomymsnokbtnsharepage"){var c=a.getAttribute("omnitureId");q(moduleList,c)}return f(d)}function p(b,c){if(b!=null){d.CustomAction_AddModule("AddModule",typeof c!="undefined"?c:"",b,max_module_count_reached);if(max_module_count_reached||isModuleAdded)window.location.href="/";else a.Call(function(a){if(a&&a!="")window.location.href="/"},"customization.aspx","Action=AddModule&ClientParams="+b)}else window.location.href="/"}function q(b){if(b!="")a.Call(function(a){if(a&&a!="")window.location.href="/"},"customization.aspx","Action=ADDSHAREDPAGE&ClientParams="+b);else window.location.href="/"}function o(b,f){if(b!=null&&e.IsValidURL(b)&&c){d.CustomAction_AddModule("AddModule",typeof f!="undefined"?f:"","url%3D"+encodeURIComponent(b),max_module_count_reached);if(max_module_count_reached||isModuleAdded)window.location.href="/";else if(qparam)a.Call(function(a){if(a&&a!="")window.location.href="/"},"customization.aspx","Action=AddModule&ClientParams=rss|q%3D"+encodeURIComponent(qparam));else a.Call(function(a){if(a&&a!="")window.location.href="/"},"customization.aspx","Action=AddModule&ClientParams=rss|url%3D"+encodeURIComponent(b))}else window.location.href="/"}function r(a){if(a!=null&&e.IsValidURL(a))window.location.href=a;else window.location.href="/"}function l(){if(navigator.userAgent.indexOf("MSIE")!=-1&&navigator.userAgent.indexOf("MSIE 7.0")==-1){var a=document.getElementById("mymsn-addtomymsn-preconShd");if(a){var b=g(a,"DIV");a.style.height=b.offsetHeight+"px"}}}function k(){var b=document.getElementById("mymsn-contentbody"),a=document.getElementById("mymsn-contentpreviewbody"),d=document.getElementById("mymsn-message");if(typeof mType!="undefined")if(mType=="rss"){if(a!=null&&(a.childNodes.length==0||a.childNodes[0].nodeType!=3?a.childNodes[0].className.indexOf("mmrss-noitems")!=-1:a.childNodes[1].className.indexOf("mmrss-noitems")!=-1)){d.innerHtml=d.innerText=errMsg;b.innerHtml=null;b.style.visibility="hidden"}else{c=true;b.style.visibility="visible"}d.style.visibility="visible"}else if(isModuleAvailable)b.style.visibility="visible"}function n(){var c=Msn.My.Utility,b=1,d=window.location.href.match(/(^.*)([\?|&]mypg=)([^&#]*)/i);if(d){b=d[3]*1;if(isNaN(b)||b<1)b=1;c.setPageNumberCookie(b)}else{var a=c.getCookie("mypg")*1;if(a!=null){if(isNaN(a)||a<1)a=1}else a=1;c.setPageNumberCookie(a)}}function s(){l();k();n();b=h.getAttribute("p");m.hook(h,"click")}s()}}).ns("Msn.My.AddToMyMSN");Msn.My.AddToMyMSN.Selector.bind("INPUT.mymsn-addtomymsn")