function RegisterNamespaces(){for(var b=0;b<arguments.length;b++){var e=arguments[b].split("."),a=window;for(var c=0;c<e.length;c++){var d=e[c];if(!a[d])a[d]=function(){};a=a[d]}if(!a._Private)a._Private=function(){}}}RegisterNamespaces("Msn.Browser","Msn.Debug.Performance");Msn.Browser.IsMozilla=function(){return typeof document.implementation!="undefined"&&typeof document.implementation.createDocument!="undefined"&&typeof HTMLDocument!="undefined"};Msn.Browser.AttachMozillaCompatibility=function(a){function e(){var b=a.document.getElementsByName("msn-moz-custom");if(b.length>0)Msn.Browser.MozillaCompatMode=b[0].getAttribute("content").toLowerCase()=="enabled";else Msn.Browser.MozillaCompatMode=false}e();function c(a){window.event=a}function i(b,a,d){a=a.slice(2);if(a!="mouseenter"&&a!="mouseleave")b.addEventListener(a,c,true);else{b.addEventListener("mouseover",c,true);b.addEventListener("mouseout",c,true);b.addEventListener("mouseover",f,false);b.addEventListener("mouseout",g,false)}b.addEventListener(a,d,false)}function f(){if(!this.contains(event.fromElement)){event.initEvent("mouseenter",false,false);this.dispatchEvent(event)}}function g(){if(!this.contains(event.toElement)){event.initEvent("mouseleave",false,false);this.dispatchEvent(event)}}function h(c,a,b){c.removeEventListener(a.slice(2),b,false)}function b(a){try{while(a&&a.nodeType!=1)a=a.parentNode}catch(b){a=null}return a}a.attachEvent=a.HTMLDocument.prototype.attachEvent=a.HTMLElement.prototype.attachEvent=function(b,a){i(this,b,a)};a.detachEvent=a.HTMLDocument.prototype.detachEvent=a.HTMLElement.prototype.detachEvent=function(b,a){h(this,b,a)};a.HTMLElement.prototype.__defineGetter__("parentElement",function(){return b(this.parentNode)});a.HTMLElement.prototype.__defineGetter__("innerText",function(){return this.textContent});a.HTMLElement.prototype.__defineSetter__("innerText",function(b){var a=document.createTextNode(b);this.innerHTML="";this.appendChild(a)});a.Event.prototype.__defineGetter__("srcElement",function(){var a=b(this.target);return a});a.Event.prototype.__defineSetter__("cancelBubble",function(a){if(a)this.stopPropagation()});function d(a){var b={x:0,y:0};while(a){b.x+=a.offsetLeft;b.y+=a.offsetTop;a=a.offsetParent}return b}a.Event.prototype.__defineGetter__("offsetX",function(){return window.pageXOffset+this.clientX-d(this.srcElement).x});a.Event.prototype.__defineGetter__("offsetY",function(){return window.pageYOffset+this.clientY-d(this.srcElement).y});a.Event.prototype.__defineSetter__("returnValue",function(a){if(!a)this.preventDefault();this.cancelDefault=a;return a});a.Event.prototype.__defineGetter__("returnValue",function(){return this.cancelDefault});a.Event.prototype.__defineGetter__("fromElement",function(){var a;if(this.type=="mouseover")a=this.relatedTarget;else if(this.type=="mouseout")a=this.target;return b(a)});a.Event.prototype.__defineGetter__("toElement",function(){var a;if(this.type=="mouseout")a=this.relatedTarget;else if(this.type=="mouseover")a=this.target;return b(a)});a.Event.prototype.__defineGetter__("button",function(){return this.which==1?1:this.which==2?4:2})};if(Msn.Browser.IsMozilla())Msn.Browser.AttachMozillaCompatibility(self);
Function.prototype.addMethod=function(a,b){if(!this.prototype[a])this.prototype[a]=b;return this};Function.addMethod("as",function(e,f){var b=e?e.split("."):[];if(b.length>0){var a=window;for(var d=0;d<b.length-1;++d){var c=b[d];if(c){if(!a[c])a[c]={};a=a[c]}}a[b.last()]=f?new this:this}return this});Function.addMethod("ns",function(a){this.as(a,1)});String.addMethod("trim",function(){return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1")});String.addMethod("collapse",function(){return this.replace(/\s+/g," ").trim()});String.addMethod("wrap",function(a){var b,c={"(":")","{":"}","[":"]","<":">","\u00c2\u00ab":"\u00c2\u00bb","\u00e2\u20ac\u00b9":"\u00e2\u20ac\u00ba","\u00e2\u20ac\u0153":"\u00e2\u20ac\u009d","\u00e2\u20ac\u02dc":"\u00e2\u20ac\u2122"};if(c[a])b=c[a];else{var d=/^<(\w+)(\s+\w+\s*=\s*"[^"]*")*\s*>$/.exec(a);if(d)b="</"+d[1]+">"}return a+this+(b?b:a)});String.addMethod("format",function(){var b=this;for(var a=0;a<arguments.length;++a)b=b.replace(new RegExp("\\{"+a+"\\}","g"),arguments[a]);return b});String.addMethod("encodeHtml",function(){var a=this.replace(/\>/g,"&gt;").replace(/\</g,"&lt;").replace(/\&/g,"&amp;").replace(/\'/g,"&#039;").replace(/\"/g,"&quot;");return a});String.addMethod("decodeHtml",function(){var a=this.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&").replace(/&#039;/g,"'").replace(/&quot;/g,'"');return a});String.addMethod("encodeURIComponent",function(){return typeof encodeURIComponent!="undefined"?encodeURIComponent(this):escape(this)});String.addMethod("decodeURIComponent",function(){return typeof decodeURIComponent!="undefined"?decodeURIComponent(this):unescape(this)});Array.addMethod("last",function(){return this.length>0?this[this.length-1]:void 0});Array.addMethod("remove",function(b){for(var a=this.length-1;a>=0;--a)if(this[a]===b)this.splice(a,1);return this});Array.addMethod("contains",function(b){for(var a=0;a<this.length;++a)if(this[a]===b)return 1;return 0});Array.addMethod("push",function(a){this[this.length]=a;return this.length});Array.addMethod("shift",function(){return this.splice(0,1)[0]});Array.addMethod("splice",function(c,d){var b,e=arguments.length-2;if(c>this.length)c=this.length;if(c+d>this.length)d=this.length-c;var f=[];for(var a=0;a<d;++a)f.push(this[c+a]);if(e>d){b=e-d;for(a=this.length+b-1;a>=c+b;--a)this[a]=this[a-b]}else if(e<d){b=d-e;for(a=c+e;a<this.length-b;++a)this[a]=this[a+b];for(;a<this.length-1;++a)delete this[a];this.length-=b}for(a=0;a<e;++a)this[c+a]=arguments[2+a];return f});(function(){var a=this;Function.addMethod("hook",function(d,e){if(d){var f=b();if(!f&&d.addEventListener)d.addEventListener(e,this,false);else if(!f&&d.attachEvent)d.attachEvent("on"+e,this);else{var c=d["x"+e];if(c&&c.constructor==Array)if(c.contains(this))c=null;else c.push(this);else c=d["x"+e]=[this];if(c){d["on"+e]=function(d){var f=true;d=a.Event(d);for(var b=0;b<c.length;++b){var e=c[b](d);if(typeof e!="undefined"&&!e)f=false}return f};d=null}}}return this});Function.addMethod("unhook",function(a,c){if(a){var e=b();if(!e&&a.removeEventListener)a.removeEventListener(c,this,false);else if(!e&&a.detachEvent)a.detachEvent("on"+c,this);else{var d=a["x"+c];if(d&&d.constructor==Array)d.remove(this);else a["on"+c]=null}}return this});a.CancelEvent=function(b){b=a.Event(b);if(b){b.cancelBubble=true;if(b.stopPropagation)b.stopPropagation();b.returnValue=false;if(b.preventDefault)b.preventDefault()}return false};a.Event=function(a){return a?a:window.event};a.Target=function(c){c=a.Event(c);var b=c.target?c.target:c.srcElement;if(b&&b.nodeType!=1)b=a.ParentElem(b);return b};a.InnerText=function(e){var c="";for(var d=0;d<e.childNodes.length;d++){var b=e.childNodes[d];if(b.nodeType==1)c+=a.InnerText(b);else if(b.nodeType==3)c+=b.data}return c};a.NextElem=function(c,b){var a=c.nextSibling;while(a&&(a.nodeType!=1||b&&a.nodeName!=b))a=a.nextSibling;return a};a.PrevElem=function(c,b){var a=c.previousSibling;while(a&&(a.nodeType!=1||b&&a.nodeName!=b))a=a.previousSibling;return a};a.ParentElem=function(c,b){var a=c.parentNode;while(a&&(a.nodeType!=1||b&&a.nodeName!=b))a=a.parentNode;return a};a.ChildElem=function(e,f,g){var d=null,b;for(var c=0;!d&&c<e.childNodes.length;++c){b=e.childNodes[c];if(b.nodeType==1)if(!f||b.nodeName==f)d=b}if(!g)for(c=0;!d&&c<e.childNodes.length;++c){b=e.childNodes[c];if(b.nodeType==1)d=a.ChildElem(b,f)}return d};a.ForEach=function(e,d,c){for(var b=0;b<d.childNodes.length;++b){var a=d.childNodes[b];if(a.nodeType==1&&(!c||a.nodeName==c))if(e(a))break}};a.ChildCount=function(d,c){var e=0,a,b;for(a=0;a<d.childNodes.length;++a){b=d.childNodes[a];e+=b.nodeType==1&&(!c||b.nodeName==c)?1:0}return e};a.AddClass=function(a,e){var c=a.className;if(c){var g=c.collapse().split(" "),d=e.collapse().split(" ");for(var b=0;b<d.length;++b){var f=d[b];if(!g.contains(f))a.className+=" "+f}}else a.className=e;return a.className};a.DelClass=function(b,g){var a=b.className;if(a){var f=a.collapse().split(" "),d=g.collapse().split(" ");for(var c=0;c<d.length;++c)f.remove(d[c]);var e=f.join(" ");if(e!=a)b.className=e}return b.className};a.HasClass=function(b,a){return b.className.collapse().split(" ").contains(a)};a.Updated=function(){if(a.Access&&typeof a.Access.Updated=="function")a.Access.Updated()};function b(){return navigator.userAgent.indexOf("Safari")>=0}}).ns("Msn.DOM");(function(){var a=this,c=[];Function.addMethod("bind",function(b,h){var d;switch(typeof b){case "object":d=b.nodeType==1||b.nodeType==9?[b]:b.length?b:null;break;case "string":d=a.Select(b)}if(d)for(var g=0;g<d.length;++g){var e=d[g],f=new this(e,h);if(e.bindings)e.bindings.push(f);else e.bindings=[f];c.push(f)}return this});a.Unbind=function(d,f){var b;if(d.bindings&&d.bindings.length){for(b=0;b<d.bindings.length;++b){var e=d.bindings[b];if(e&&typeof e.dispose=="function")e.dispose();c.remove(e)}d.bindings=null}if(f)for(b=0;b<d.childNodes.length;++b){var g=d.childNodes[b];if(g.nodeType==1)a.Unbind(g,f)}};a.Select=function(c){function i(){var d=null;if(c)if(c.charAt(a)=="*")d="*";else while(a<c.length){var b=c.charAt(a);if("a"<=b&&b<="z"||"A"<=b&&b<="Z"||"0"<=b&&b<="9"||b=="-"){d=d?d+b:b;++a}else break}return d}function j(){while(a<c.length&&c.charAt(a)==" ")++a}function m(){var b=null;j();switch(c.charAt(a)){case "+":case ">":b=c.charAt(a);++a;j()}return b}function h(){++a;return i()}function g(){var b=null,d=i();if(d!==null)b=new e(d);while(c&&a<c.length){var f=c.charAt(a);if(f=="#"){if(!b)b=new e;b.setID(h())}else if(f=="."){if(!b)b=new e;b.addClass(h())}else break}return b}function n(){var d=[],b=g();if(b){d.push(b);while(a<c.length){var e=m();b=g();if(b){if(e)b.setComb(e);d.push(b)}else break}}return d}function e(a){var g=this,e="",f=null,d=null;g.setID=function(a){e=a};g.setComb=function(a){f=a};g.addClass=function(a){if(d)d.push(a);else d=[a]};g.getNodes=function(i){var d,g,j,k=[];if(e){switch(f){case ">":for(d=0;d<i.childNodes.length;++d)if(i.childNodes[d].nodeType==1&&i.childNodes[d].id==e){g=i.childNodes[d];break}break;case "+":j=b(i);if(j&&j.id==e)g=j;break;default:g=i.getElementById(e)}if(g&&(!a||a=="*"||a.toLowerCase()==g.nodeName.toLowerCase())&&c(g))k.push(g)}else if(a&&a!="*")switch(f){case ">":for(d=0;d<i.childNodes.length;++d){g=i.childNodes[d];if(g.nodeType==1&&g.nodeName.toLowerCase()==a&&c(g))k.push(g)}break;case "+":j=b(i);if(j&&j.nodeName.toLowerCase()==a&&c(j))k.push(j);break;default:var l=i.getElementsByTagName(a);for(d=0;d<l.length;++d)if(c(l[d]))k.push(l[d])}else switch(f){case ">":for(d=0;d<i.childNodes.length;++d){g=i.childNodes[d];if(g.nodeType==1&&c(g))k.push(g)}break;case "+":j=b(i);if(j&&c(j))k.push(j);break;default:h(i,k)}return k};function h(d,e){for(var b=0;b<d.childNodes.length;++b){var a=d.childNodes[b];if(a.nodeType==1){if(c(a))e.push(a);h(a,e)}}}function c(f){var a=1;if(d){var c=f.className;if(c){var e=c.collapse().split(" ");for(var b=0;b<d.length;++b)if(!e.contains(d[b])){a=0;break}}else a=0}return a}}function l(c,d){var a=[];for(var b=0;b<c.length;++b)a=a.concat(d.getNodes(c[b]));return a}var a=0,k=n(),d=[document];for(var f=0;f<k.length&&d.length>0;++f)d=l(d,k[f]);return d};function b(b){var a=b.nextSibling;while(a&&a.nodeType!=1)a=a.nextSibling;return a}(function(){a.Unbind(document,1);c=[]}).hook(window,"unload")}).ns("Msn.Bind");(function(j,e){if(!e)e={};var g=Msn.DOM,d=document,k=window,c=d.getElementById("more");c.style.display="none";var f=d.getElementById("xnav"),b=d.createElement("li"),a=d.createElement("a");a.href="#";a.className="expand";a.innerHTML=h(e.more,"more");b.appendChild(a);f.appendChild(b);i.hook(a,"click");function i(f){var d=c.style.display,e;if(d=="block"){d="none";e="expand";b.className=""}else{d="block";e="collapse";b.className="last"}c.style.display=d;a.className=e;f=g.Event(f);return g.CancelEvent(f)}this.dispose=function(){j=null;c=null;f=null;b=null;a=null};function h(a,b){return typeof a!="undefined"?a:b}}).as("Msn.Header");(function(C,d){if(!d)d={};var f=Msn.DOM,b=document,I=window,c=C,F=e(d.siteSearchOn,"false"),A=e(d.searchUrl,""),G=e(d.searchParam,""),u=e(d.searchParams,""),h=F=="true"?"site":"web";if(h=="site")D();var H=e(d.onepxgif,"http://blstc.msn.com/br/gbl/css/8/decoration/t.gif"),r=navigator.userAgent,q=r.indexOf("MSIE");if(q>=0)if(parseFloat(r.substring(q+4))<7&&parseFloat(r.substring(q+4))>5){g(b.getElementById("ntwseperator"),"bgimage","image");g(b.getElementById("leftcorner"),"bgimage","image");g(b.getElementById("searchform"),"bgimage","scale");g(b.getElementById("ntwlogo"),"bgimage","scale");g(b.getElementById("logoimg"),"img","image");g(b.getElementById("rightcorner"),"bgimage","image");g(n,"bgimage","image")}var k,i,j,n,p,z=b.getElementById("spyglass"),a=b.getElementById("q"),m="",l=h=="web"?e(d.helpertext,""):"";if(h=="web")a.className="";a.value=l;y.hook(z,"click");w.hook(a,"focus");x.hook(a,"blur");var t=c.onsubmit;c.onsubmit=function(){if(a.value==l)a.value="";return !!t?t(c):null};B.hook(a,"keypress");function D(){var a=b.getElementById("ntwscopes"),g=e(d.sitetext,"Search site"),h=e(d.webtext,"Web");k=b.createElement("div");k.className="selected";i=b.createElement("a");i.innerHTML=g;i.href=A;n=b.createElement("span");n.id="selectedscope";k.appendChild(i);k.appendChild(n);var f=b.createElement("div");f.id="ntwseperator";p=b.createElement("div");j=b.createElement("a");j.innerHTML=h;j.href=c.action;p.appendChild(j);a.appendChild(k);a.appendChild(f);a.appendChild(p);o.hook(i,"click");v.hook(j,"click")}function g(a,c,e){if(!a)return;var b;if(c=="bgimage")b=a.currentStyle.backgroundImage;else if(c=="img")b=a.src;if(b=="")return;var d=b.search(new RegExp("(http[s]?://.+\\.png)","i"))===-1?"":RegExp.$1;if(d.length>0){if(c=="bgimage")a.style.backgroundImage="none";else if(c=="img")a.src=H;a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='"+e+"', src='"+d+"')"}}function B(a){if(a.keyCode==13)switch(h){case "site":o(null);a=f.Event(a);return f.CancelEvent(a)}}function o(b){var a=A+"?"+G+"="+s();if(u)a=a+"&"+u.replace(/&amp;/g,"&");if(b&&f.Target(b).tagName.toLowerCase()=="a")f.Target(b).href=a;else window.top.location.href=a}function v(d){if(d&&f.Target(d).tagName.toLowerCase()=="a"){var e=f.Target(d),b=c.action;for(var a=0;a<c.length;a++){if(a==0)b+="?";else b+="&";if(c[a].name.toLowerCase()=="q")b+=c[a].name+"="+s();else b+=c[a].name+"="+encodeURIComponent(c[a].value)}e.href=b}}function s(){m=a?a.value:"";if(h=="web")m=m==l?"":m;return encodeURIComponent(m)}function y(){switch(h){case "site":c.onsubmit=E;o(null)}}function E(a){a=f.Event(a);return f.CancelEvent(a)}function w(){a.className="typing";if(a.value==l)a.value=""}function x(){if(a.value.trim()==""){a.className="";a.value=l}}this.dispose=function(){if(h="site"){o.unhook(i,"click");v.unhook(j,"click")}y.unhook(z,"click");w.unhook(a,"focus");x.unhook(a,"blur");B.unhook(a,"keypress");c.onsubmit=null;C=null};function e(a,b){return typeof a!="undefined"?a:b}}).as("Msn.SiteSearch");
if(!window.Msn)window.Msn={};Msn.Report=new function(){var b=this,a=window;this.TrackEvent=function(e,d,f,c,b){if(!b)b="";if(Msn.Linktracking){var h={prop11:e,prop13:d,prop14:f,prop16:b,prop15:a.s.pageName};Msn.Linktracking.TrackReport(c,h)}if(Msn.Gtracking){var g=Msn.Gtracking.CreateReport2(c,e,d,f,b);if(g)Msn.Gtracking.TrackReport(g)}};this.TrackForm=function(a){var b,c=true;if(Msn.Linktracking){b=Msn.Linktracking.CreateReport(a);if(b)c=Msn.Linktracking.TrackReport(a.getAttribute("action"),b)}if(Msn.Gtracking){var d=Msn.Gtracking.CreateReport(a);if(d)c=Msn.Gtracking.TrackReport(d)}return c};return this};
if(!window.Msn)window.Msn={};Msn.Navigation=new function(){var b=Msn.DOM,a=window,c=document;this.OpenNew=function(f,c){var d=null,e=b.Event(f);if(c.href){d=a.open(c.href);if(d&&Msn.Gtracking)Msn.Gtracking.TrackClick(c);if(d&&Msn.Linktracking)Msn.Linktracking.CreateReport(c)}return b.CancelEvent(e)};this.OpenPopup=function(i,d,j,f,g){var h=b.Event(i);if(d.href){var e=d.href;if(!f)f="";if(g)e=e+"&"+g+"="+document.URL;var c=a.open(e,f,j);if(c)c.focus();if(Msn.Gtracking)Msn.Gtracking.TrackClick(d,!c?"BLOCKED":"");if(Msn.Linktracking)Msn.Linktracking.CreateReport(d,!c?"BLOCKED":"")}return b.CancelEvent(h)};this.AddBookmark=function(i,f,e){var h=b.Event(i);if(a.external&&typeof a.external.AddFavorite!="undefined"){var d=f.href,g=f.getAttribute("title");a.external.AddFavorite(d!="#"&&d!=c.location.href+"#"?d:c.location.href,g?g:c.title)}else{var j=e?e:"Press {0} to bookmark this page.";a.alert(j.replace("{0}",a.navigator.platform.indexOf("Mac")<0?"Ctrl+D":"Command+D"))}return b.CancelEvent(h)}};;

var _daprr=new Array('http://rad.msn.com/ADSAdClient31.dll?GetSAd=','http://a.rad.msn.com/ADSAdClient31.dll?GetSAd=', 'http://b.rad.msn.com/ADSAdClient31.dll?GetSAd=');var _daprs=0;var _daplp='http://ads1.msn.com/library';var acbMinWdth=160;var acbAdBarH=22;var acbDwnLdSt=false;var DPJS_BSC=0;var DPJS_ACB=1;var DPJS_4TH=2;var DPJS_ADV=4;function dap(qs,fw,fh,ob)
{var rs=_daprr[_daprs++];if(_daprs>=_daprr.length)_daprs=0;var dapIfs="";if(typeof(ob)!='undefined')
{ob=true;if(rs.length>0)
{rs+='&DPJS='+(DPJS_BSC+DPJS_4TH);}}
else
{ob=false;if(rs.length>0)
{rs+='&DPJS='+DPJS_BSC;}}
rs+=dapQSTrack;if(_dapUtils.is_ie5up&&_dapUtils.is_win&&!ob)
{dapIfs='dapIf'+(parseInt(parent.frames.length)+1);document.write('<iframe id="'+dapIfs+'" src="about:blank" width="'+fw+'" height="'+fh+'" frameborder="0" scrolling="no"></iframe>');document.frames[dapIfs].document.open("text/html","replace");document.frames[dapIfs].document.write('<html><head><title>Advertisement</title></head><body id="'+dapIfs+'" leftmargin="0" topmargin="0"><scr'+'ipt type="text/javascript">var inDapIF=true;</scr'+'ipt><scr'+'ipt type="text/javascript" src="'+rs+qs+'" onreadystatechange="startTimer();"></scr'+'ipt><scr'+'ipt type="text/javascript">function startTimer(){if (event.srcElement.readyState == "complete") {window.setTimeout("document.close();", 2000);}}</scr'+'ipt></body></html>');}
else
{document.write('<scr'+'ipt src="'+rs+qs+'" type="text/javascript" language="JavaScript"></scr'+'ipt>');}}
function verifyDapResize(idx)
{if(!adCont[idx].resizeCalled&&adCont[idx].acbObj.enabled)
{dap_Resize(adCont[idx].ifrmid,adCont[idx].w,adCont[idx].h);}}
function dap_Resize(fid,fw,fh)
{document.getElementById(fid).width=fw;document.getElementById(fid).height=fh;if(fw>0&&fh>0)
{acbAdResize(fid,fw,fh);}}
function dapOAF(qs,oa,fw,fh)
{dap(qs,fw,fh);}
_dapUtilClass=function()
{var ua=navigator.userAgent.toLowerCase();var av=navigator.appVersion.toLowerCase();this.minorVer=parseFloat(av);this.majorVer=parseInt(this.minorVer);this.is_opera=(ua.indexOf("opera")!=-1);this.is_mac=(ua.indexOf("mac")!=-1);this.is_ff=(ua.indexOf("firefox")!=-1);var iePos=av.indexOf('msie');if(iePos!=-1)
{if(this.is_mac)
{var iePos=ua.indexOf('msie');this.minorVer=parseFloat(ua.substring(iePos+5,ua.indexOf(';',iePos)));}
else
{this.minorVer=parseFloat(av.substring(iePos+5,av.indexOf(';',iePos)));}
this.majorVer=parseInt(this.minorVer);}
this.is_ie=((iePos!=-1)&&(!this.is_opera));this.is_ie3=(this.is_ie&&(this.majorVer<4));this.is_ie4=(this.is_ie&&this.majorVer==4);this.is_ie4up=(this.is_ie&&this.minorVer>=4);this.is_ie5=(this.is_ie&&this.majorVer==5);this.is_ie5up=(this.is_ie&&this.minorVer>=5);this.is_ie5_5=(this.is_ie&&(ua.indexOf("msie 5.5")!=-1));this.is_ie5_5up=(this.is_ie&&this.minorVer>=5.5);this.is_ie6=(this.is_ie&&this.majorVer==6);this.is_ie6up=(this.is_ie&&this.minorVer>=6);this.is_webtv=(ua.indexOf("webtv")!=-1);this.is_msn=(av.indexOf("msn")>=0);this.is_win=((ua.indexOf("win")!=-1)||(ua.indexOf("16bit")!=-1));this.is_mac=(ua.indexOf("mac")!=-1);if(this.is_mac){this.is_win=!this.is_mac;}
if(this.is_ff)
{this.ffPos=ua.indexOf("firefox");if(ua.length>this.ffPos+8)
{this.majorVer=parseInt(ua.substring(this.ffPos+8));}
if(ua.length>this.ffPos+10)
{this.minorVer=parseInt(ua.substring(this.ffPos+10));}
this.is_ff1_5up=(this.is_ff&&((this.majorVer>=1&&this.minorVer>=5)||(this.majorVer>=2)));this.is_ff_closeIfrm=this.is_ff1_5up&&this.majorVer<3;}
this.has_Flash=false;this.FlashVer=0;this.detectFlash=function()
{if(this.is_win&&this.is_ie4up)
{var dynaFrame='<iframe id="flashDetect" src="about:blank" width="1" height="1" frameborder="0" scrolling="no" style="display:none;"></iframe>';document.body.insertAdjacentHTML("afterBegin",dynaFrame);winObject=window["flashDetect"];docObject=winObject.document;top.isFlashVersion=0;top.isFlash=false;docObject.write('<SCR'+'IPT LANGUAGE=VBScript\> \n');docObject.write('Dim hasPlayer, playerversion \n');docObject.write('playerversion = 10 \n');docObject.write('Do While playerversion > 0 \n');docObject.write('On Error Resume Next \n');docObject.write('hasPlayer = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & playerversion))) \n');docObject.write('If hasPlayer = true Then Exit Do \n');docObject.write('playerversion = playerversion - 1 \n');docObject.write('Loop \n');docObject.write('top.isFlashVersion = playerversion \n');docObject.write('top.isFlash = hasPlayer \n');docObject.write('</SCR'+'IPT\>');docObject.close();this.has_Flash=top.isFlash;this.FlashVer=top.isFlashVersion;document.all["flashDetect"].removeNode(true);}}
this.hasCookie=function(cookieName)
{var bHasCookie=false,sCookie=document.cookie,aCookie=sCookie.split(";");for(var i=0;i<aCookie.length;i++)
{while(aCookie[i].substr(0,1)==' ')
{aCookie[i]=aCookie[i].substr(1);}
if(aCookie[i].indexOf(cookieName+'=')==0)
{bHasCookie=true;break;}}
return bHasCookie;}
this.rendMode=function()
{var m=document.compatMode;if(m)
{if(m=="BackCompat")
{return"Q";}
else if(m=="CSS1Compat")
{return"S";}}
return"U";}
this.getCurrentStyle=function(e)
{if(window.getComputedStyle)
{if(window.getComputedStyle(e,null))
{return window.getComputedStyle(e,null);}
else
{return document.defaultView.getComputedStyle(e,null);}}
else
{return e.currentStyle;}}
this.brLanguage="";if(this.is_ie5up)
{this.brLanguage=navigator.browserLanguage;}
else
{this.brLanguage=navigator.language;}
this.acbEvtH=false;}
var _dapUtils=new _dapUtilClass();var adCont=new Array();var dapAd=new Object();dapAd=function(qs,divid,fid,fw,fh,iA,adid,th,wc,acbO)
{this.qs=qs;this.divid=divid;this.ifrmid=fid;this.w=fw;this.h=fh;this.isActive=iA;this.adid=adid;this.threshold=th;this.wc=wc;this.acbObj=acbO;this.documentClosed=false;this.resizeCalled=false;}
var AdControlBar=new Object();AdControlBar=function(enabled)
{this.enabled=enabled;this.shAcbLbl=false;this.fbFmShwn=false;this.fbSbmted=false;this.G=null;this.nS=null;this.pid=null;this.fn=null;this.mX=-1;this.xY=-1;this.noacb=false;this.lblCls=false;this.winCls=false;}
var eventType=new function()
{this.click=1;};var eventPriority=new function()
{this.special=2;this.regular=1;};var dapMgr=new function()
{this.threshold=eventType.click;this.MAX_AD_NUM=100;this.dtRefresh=new Date().getTime();this.REFESH_ELAPSE=2000;this.MAX_ITR_FF=5;this.TIME_EACH_ITR=2000;this.renderAd=function(divid,qs,fw,fh)
{var idx=this.getAdItemIndex(divid);if(idx>-1)
{adCont[idx].qs=qs;adCont[idx].divid=divid;adCont[idx].w=fw;adCont[idx].h=fh;}
else
{if(adCont.length<this.MAX_AD_NUM)
{var aO=new dapAd(qs,divid,'dapIfM'+adCont.length,fw,fh,false,-1,this.threshold,0,new AdControlBar(true));if(_dapUtils.is_ie5)
{adCont[adCont.length]=aO;}
else
{adCont.push(aO);}}
else
{return;}
idx=adCont.length-1;}
this.displayAd(idx);}
this.enableACB=function(divid,acb)
{var idx=this.getAdItemIndex(divid);if(idx>-1)
{adCont[idx].acb=acb;}
else
{if(adCont.length<this.MAX_AD_NUM)
{var aO=new dapAd("",divid,'dapIfM'+adCont.length,0,0,false,-1,this.threshold,0,new AdControlBar(acb));if(_dapUtils.is_ie5)
{adCont[adCont.length]=aO;}
else
{adCont.push(aO);}}}}
this.getAdItemIndex=function(divid)
{var i;for(i=0;i<adCont.length;i++)
{if(adCont[i].divid==divid)
{return i;}}}
this.displayAd=function(idx)
{var rs=_daprr[_daprs++];if(_daprs>=_daprr.length)
{_daprs=0;}
var elm=document.getElementById(adCont[idx].divid);if(!elm)
{return;}
if(!adCont[idx].qs||adCont[idx].qs.length==0)
{return;}
if(adCont[idx].isActive)
{return;}
if(adCont[idx].acbObj!=null&&adCont[idx].acbObj.fbFmShwn)
{return;}
for(var i=(elm.childNodes.length-1);i>=0;i--)
{var fChd=elm.childNodes[i];if(_dapUtils.is_ff1_5up&&(fChd.id==adCont[idx].ifrmid))
{if(fChd.contentDocument.body)
{while(fChd.contentDocument.body.firstChild)
{fChd.contentDocument.body.removeChild(fChd.contentDocument.body.firstChild);}}
fChd.id=null;fChd.name=null;fChd.style.display='none';fChd=null;}
else
{if(fChd.nodeName=="IFRAME"&&!_dapUtils.is_ie5_5)
{fChd.contentWindow.document.location.replace("about:blank");}
elm.removeChild(fChd);if(_dapUtils.is_ie5up)
{fChd.removeNode(true);}
else
{fChd=null;}}}
var elmCS=_dapUtils.getCurrentStyle(elm);if(elmCS)
{var elmStyle=elmCS.display;if(elmStyle=="none"||elmStyle=="hidden")
{return;}}
if((_dapUtils.is_ie5_5up||_dapUtils.is_ff1_5up)&&_dapUtils.is_win)
{var dapIfs=adCont[idx].ifrmid;var ifrm=document.createElement("IFRAME");ifrm.id=dapIfs;ifrm.name=dapIfs;ifrm.src="about:blank";ifrm.width=adCont[idx].w;ifrm.height=adCont[idx].h;ifrm.scrolling="no";ifrm.frameBorder="0";ifrm.allowTransparency=true;elm.insertBefore(ifrm,elm.firstChild);if(rs.length>0)
{if(adCont[idx].acbObj.enabled)
{rs+='&DPJS='+(DPJS_ADV+DPJS_ACB);}
else
{rs+='&DPJS='+DPJS_ADV;}}
rs+=dapQSTrack;var str=this.getDapOutput(rs+adCont[idx].qs,dapIfs,idx);if(_dapUtils.is_ie5_5up)
{ifrm.src="javascript:void(document.write('"+str+"'));";}
else
{ifrm.contentDocument.write(str);ifrm.contentDocument.onload=verifyDapResize(idx);if(_dapUtils.is_ff_closeIfrm)
{window.setTimeout("checkIFrameClosed("+idx+",1)",this.TIME_EACH_ITR);}
else
{ifrm.contentDocument.close();}}
if(adCont[idx].acbObj.enabled)
{initACB(adCont[idx].divid,idx);}}
else
{if(rs.length>0)
{rs+='&DPJS='+DPJS_ADV;}
rs+=dapQSTrack;var _dapdownlevel=true;if(parent.frames)
{var dapIfs=adCont[idx].ifrmid;elm.innerHTML+='<iframe id="'+dapIfs+'" src="about:blank" width="'+adCont[idx].w+'" height="'+adCont[idx].h+'" frameborder="0" scrolling="no"></iframe>';var doc;if(document.frames)
{if(document.frames[dapIfs])
{doc=document.frames[dapIfs].document;}}
else
{if(document.getElementById(dapIfs))
{doc=document.getElementById(dapIfs).contentDocument;}}
if(doc)
{_dapdownlevel=false;doc.open("text/html","replace");doc.write(this.getDapOutput(rs+adCont[idx].qs,dapIfs,idx));if(_dapUtils.is_ff_closeIfrm)
{window.setTimeout("checkIFrameClosed("+idx+",1)",this.TIME_EACH_ITR);}
else if(!_dapUtils.is_ie)
{doc.close();}}}
if(_dapdownlevel)
{document.write('<scr'+'ipt src="'+rs+adCont[idx].qs+'" type="text/javascript" language="JavaScript"></scr'+'ipt>');adCont[idx].ifrmid=null;}}}
this.getDapOutput=function(rs,dapIfs,idx)
{var s='<html><head><title>Advertisement</title></head><body id="'+dapIfs+'" leftmargin="0" topmargin="0" style="background-color:transparent"><scr'+'ipt type="text/javascript">var inDapIF=true; var inDapMgrIf=true;';if(document.domain&&location.hostname!=document.domain)
{s+='document.domain="'+document.domain+'";';}
if(_dapUtils.is_ff_closeIfrm)
{s+='var fnPtr=document.close;document.close=function(){parent.adCont['+idx+'].documentClosed = true;document.close=fnPtr};';}
s+='</scr'+'ipt><scr'+'ipt type="text/javascript"  src="'+rs+'" onreadystatechange="startTimer();"></scr'+'ipt><scr'+'ipt type="text/javascript">function startTimer()'+'{if (event.srcElement.readyState == "complete") {parent.verifyDapResize('+idx+');window.setTimeout("document.close();", 2000);}}</scr'+'ipt></body></html>';return s;}
this.trackEvent=function(evtType,evtPr)
{var i;var isRef;if(!evtPr)
{evtPr=eventPriority.regular;}
for(i=0,isRef=false;i<adCont.length;i++)
{adCont[i].wc+=(evtType*evtPr);var tElp=(new Date()).getTime()-this.dtRefresh;if((adCont[i].wc>=adCont[i].threshold)&&(tElp>this.REFESH_ELAPSE))
{adCont[i].wc=0;if(adCont[i].threshold>-1&&adCont[i].ifrmid!=null)
{this.displayAd(i);isRef=true;if(adCont[i].acbObj.enabled&&adCont[i].acbObj.fbSbmted)
{adCont[i].acbObj.fbSbmted=false;}}}}
if(isRef)
{this.dtRefresh=(new Date()).getTime();}}};function checkIFrameClosed(idx,iterations)
{var ifrm=document.getElementById(adCont[idx].ifrmid);if(ifrm)
{if(iterations>=dapMgr.MAX_ITR_FF&&!adCont[idx].documentClosed)
{ifrm.contentDocument.close();}
if(adCont[idx].documentClosed)
{try
{ifrm.contentDocument.close();}
catch(e){}}
else
{window.setTimeout("checkIFrameClosed("+idx+","+(iterations+1)+")",dapMgr.TIME_EACH_ITR);}}}
function acbAdResize(df,w,h)
{for(var i=0;i<adCont.length;i++)
{if(adCont[i].ifrmid==df)
{if(w<acbMinWdth)
{adCont[i].acbObj.noacb=true;if(_dapUtils.acbEvtH)
{_acb.removeACBLabel(i);}}
else
{if(_dapUtils.acbEvtH)
{_acb.showACBLabel(i);}}
adCont[i].w=w;adCont[i].h=h;var o=document.getElementById(adCont[i].divid);if(o)
{o.style.width=w+"px";if(_dapUtils.is_ff1_5up&&_dapUtils.rendMode()=="S"&&h>1)
{var dh=h;if(!adCont[i].acbObj.noacb&&adCont[i].acbObj.enabled)
{dh+=acbAdBarH;}
o.style.height=dh+"px";}}
var ol=document.getElementById("acbLblfrm"+i);if(ol)
{ol.style.width=w+"px";}
adCont[i].resizeCalled=true;return;}}}
function initACB(divid,Id)
{if(!_dapUtils.acbEvtH)
{if(!acbDwnLdSt)
{acbDwnLdSt=true;var d=document.createElement("SCRIPT");d.type="text/javascript";d.language="javascript";d.src=_daplp+"/ACB/acb.js";document.body.insertBefore(d,document.body.firstChild);}}
else
{_acb.initACBLabel(Id);}}
function ShowAcb(idStr,adId,W,H,G,nS,pid,fn)
{var Id=acbGetIdFrmIdStr(idStr);if(Id>-1)
{adCont[Id].adid=adId;adCont[Id].w=W;var acbO=adCont[Id].acbObj;acbO.shAcbLbl=true;acbO.fn=fn;acbO.G=G;acbO.nS=nS;acbO.pid=pid;if(_dapUtils.acbEvtH)
{_acb.showACBLink(Id);}
return;}}
function acbGetIdFrmIdStr(s)
{var id=s.substring(6,s.length);if(id>=0)
{return id;}
else
{return-1;}}
function dapExtractValue(str,key,eS)
{if(str!=null)
{var strKeyPS=str.toLowerCase().indexOf(key.toLowerCase()+'=');if(strKeyPS!=-1)
{strKeyPS+=key.length+1;var strKeyPE=str.indexOf(eS,strKeyPS);strKeyPE=(strKeyPE==-1)?str.length:strKeyPE;return str.substring(strKeyPS,strKeyPE);}}
return'';}
function dapQSTracking()
{var c=document.cookie;var mh=unescape(dapExtractValue(c,'mh',';'));var qs=(mh!='')?'&PN='+mh:'';if(location.hostname.toLowerCase().indexOf('.live.com')!=-1)
{var id=dapExtractValue(unescape(dapExtractValue(c,'ANON',';')),'A','&');var muid=unescape(dapExtractValue(c,'MUID',';'));if(id=='')
{id=muid;}
qs+=(id!='')?'&ID='+id:'';qs+=(muid!='')?'&MUID='+muid:'';}
return qs;}
var dapQSTrack=dapQSTracking();;

if(window.Msn.Dap===undefined){window.Msn.Dap={};}
$(function(){var placeholderContaners=$('div.placeholderad');placeholderContaners.each(function(i){var placeholderad=$(this);switch(placeholderad.data("ADSTAT")){case"LIVE_ERROR":placeholderad.parent(".placeholder").remove();break;case"PREVIEW_ERROR":placeholderad.find(".placeholder_errorinfo div").append(" , "+placeholderad.data("ERRMSG"));placeholderad.find(".placeholder_errorinfo").css("display","block");placeholderad.find(".advertisement").css("display","none");break;default:placeholderad.find(".placeholder_errorinfo").remove();}});});Msn.Dap.outputAdvertisement=function(pg,ap,width,height){var isprev=$("input[name=dapispreview]").attr("value");var placeholderContaners=$('div.placeholderad');if(placeholderContaners.length){placeholderContaners.each(function(){var placeholderad=$(this);if(placeholderad.data("LOADED")!==true){var phclass=placeholderad.parent("div.placeholder").attr("class");var phlayout=phclass.split(" ");var phwidth;for(var a=0;a<phlayout.length;a++){if(phlayout[a].indexOf("phw")>-1){phwidth=phlayout[a];break;}}
var dapwidth=placeholderad.find("input[name=dapad_width]").attr("value");var page_layout=placeholderad.find("input[name=page_layout]").attr("value");var adErrMessage=Msn.Dap.checkAdDimension(phwidth,page_layout,dapwidth);if(isprev!=="true"&&adErrMessage.length>0){placeholderad.data("ADSTAT","LIVE_ERROR");}else{if(adErrMessage.length>0){placeholderad.data("ADSTAT","PREVIEW_ERROR");placeholderad.data("ERRMSG",adErrMessage);}
else{placeholderad.data("ADSTAT","CORRECT");var dapstr="<scr"+"ipt type=\"text/javascript\">";dapstr+="dap(\"&amp;PG="+pg+"&amp;AP="+ap+"\" ,"+width+" , "+height+")";dapstr+="<"+"/scr"+"ipt>";placeholderad.find(".advertisement").append(dapstr);}}
placeholderad.data("LOADED",true);}});}}
Msn.Dap.checkAdDimension=function(phwidth,pagelayout,dapwidth){switch(pagelayout){case"3Col_ArticleLeft":case"3Col_ArticleCentre":return Msn.Dap.checkDimensionFor3Col(phwidth,dapwidth);case"2Col":return Msn.Dap.checkDimensionFor2Col(phwidth,dapwidth);}
return"";}
Msn.Dap.checkDimensionFor3Col=function(phwidth,dapwidth){switch(phwidth){case"phw100":if(dapwidth!=="300"){return"only advertisements of width <strong>300</strong> is allowed according to your layout setting(<strong>100%</strong> width Placeholder , <strong>3 columns</strong> page layout)."}
break;case"phw65":if(dapwidth!=="234"){return"only advertisements of width <strong>234</strong> is allowed according to your layout setting.(<strong>65%</strong> width Placeholder , <strong>3 columns</strong> page layout)"}
break;case"phw47":if(dapwidth!=="180"){return"only advertisements of width <strong>180</strong> is allowed according to your layout setting.(<strong>47%</strong> width Placeholder , <strong>3 columns</strong> page layout)"}
break;case"phw35":return"no advertisement of any dimension is allowed according to your layout setting.(35% width Placeholder , 3 columns page layout)";}
return"";}
Msn.Dap.checkDimensionFor2Col=function(phwidth,dapwidth){switch(phwidth){case"phw100":return"no advertisement of any dimension is allowed according to your layout setting.(100% width Placeholder , 2 columns page layout)";case"phw65":if(dapwidth!=="300"){return"only advertisements of width <strong>300</strong> is allowed according to your layout setting.(<strong>65%</strong> width Placeholder , <strong>2 columns</strong> page layout)"}
break;case"phw47":if(dapwidth!=="234"){return"only advertisements of width <strong>234</strong> is allowed according to your layout setting.(<strong>47%</strong> width Placeholder , <strong>2 columns</strong> page layout)"}
break;case"phw35":if(dapwidth!=="180"){return"only advertisements of width <strong>180</strong> is allowed according to your layout setting.(<strong>35%</strong> width Placeholder , <strong>2 columns</strong> page layout)"}}
return"";}
