var dxWxB = {}; (function() { var $x = {}; var $s = {}; var $f_o = ""; var $ss_o = ''; var isPer = false; function makeBadge() { var we = $x.weather || $s.weather; var f = we.conditions; if (f.cid == '-na-' || f.cid == '') { f.cid = we.forecast[0].cid; f.text = we.forecast[0].cond; f.temp = (we.forecast[0].hi!='-na-'&&we.forecast[0].hi!='')?(we.forecast[0].hi +' / '+we.forecast[0].lo):we.forecast[0].lo; } f.text = f.text.toLowerCase(); var nc = (isPer)?(''):(' nocookie'); $f_o += ''+we.city+''; $f_o += ''+f.text+', '+f.temp+''; $f_o += 'Edit'; var isBW = (isPer)?(''):('_bw'); var bdg = document.getElementById('wx-badge'); bdg.innerHTML = $f_o; var bodystyles = document.getElementsByTagName('body')[0].className; var p = bdg.childNodes[1].firstChild; if (bodystyles.indexOf('IE-6')!=-1) { var marquee = document.getElementById('marquee-site'); if(marquee != null) { var b = document.getElementById('coverbadge'); b.style.top = '12px'; } p.style.backgroundImage = 'none'; p.style.height = '1px'; p.style.width = '270px'; p.style.paddingTop = '30px'; p.style.textAlign = 'right'; p.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://msnbcmedia.msn.com/i/msnbc/Components/CSS/img/weather/WC'+f.cid+'.png", sizingMethod="crop")'; }else{ p.style.background = 'url("http://msnbcmedia.msn.com/i/msnbc/Components/CSS/img/weather/WC'+f.cid+isBW+'.png") bottom left no-repeat'; } } function onLoad() { var pz = Utils.getPersonalization(); if (pz != undefined) { if (pz.locCode != null) { $x = DBMgr.cookied.getData(); $s = DBMgr.def.getData(); isPer = true; } else { $x = DBMgr.def.getData(); } } else { $x = DBMgr.def.getData(); } makeBadge(); } dxWxB.onLoad = onLoad; })(); DBMgr.init(); DBMgr.subscribe(dxWxB.onLoad); DBMgr.start();