var LocalDS = function() { arguments.callee.superclass.constructor.call(this); }; Utils.subclass(LocalDS, DefaultDS); LocalDS.prototype.isParsed = false; LocalDS.prototype.parse = function(result) { result = result.replace(/\n/g, ''); result = result.replace(/"error":\{"msg"\:"Weather data not available"\}\]\}/g, '"error":{"msg":"Weather data not available"}'); result = result.replace(/"error":\{"msg"\:"Score data not available"\}\]\}/g, ''); result = result.replace(/\{"foo"\:"null"\},?/g, ''); this.evaluate(result); }; var dxWxB = {}; var lhDS; var ms_pref; (function() { var $x = {}; var $f_o = ""; var $w_o = ""; var $m_o = ""; var $s_o = ""; var $l_o = ""; var isPer = true; function makeBadge() { var we = $x.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 + ''; 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() { $x = lhDS.getData(); makeBadge(); } dxWxB.onLoad = onLoad; })(); function loadSpecial() { ms_pref = "d"; lhDS.load(DataboxService.COOKIED_DB, '01||,' + lhLoc + '|=108|0<|' + lhNws + '|' + lhMkt + '|||||' + lhSpt + '|~' + lhLoc.substring(2,4)); } lhDS = new LocalDS(); lhDS.addListener(lhDS, DataboxService.EVENT_LOAD, dxWxB.onLoad); if (typeof lhLoc != "undefined") { loadSpecial(); }