(function(n){function i(n){var t=Math.floor(Math.log(n)/Math.log(1024));return(n/Math.pow(1024,Math.floor(t))).toFixed(2)+" "+["bytes","kb","MB","GB","TB","PB"][t]}function r(n){var i=navigator.appName,t;return i=="Microsoft Internet Explorer"?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(n)):t=(new DOMParser).parseFromString(n,"text/xml"),t}n.fn.rssfeed=function(i,r,u){var r=n.extend({limit:10,header:!0,date:!0,content:!0,snippet:!0,media:!0,showerror:!0,errormsg:"",key:null,ssl:!1,linktarget:"_self"},r);return this.each(function(f,e){var s=n(e),h="",o;if(r.ssl&&(h="s"),s.hasClass("rssFeed")||s.addClass("rssFeed"),i==null)return!1;o="http"+h+"://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+encodeURIComponent(i);r.limit!=null&&(o+="&num="+r.limit);r.key!=null&&(o+="&key="+r.key);o+="&output=json_xml";n.getJSON(o,function(i){var f;i.responseStatus==200?(t(e,i.responseData,r),n.isFunction(u)&&u.call(this,s)):(r.showerror&&(f=r.errormsg!=""?r.errormsg:i.responseDetails),n(e).html('<div class="rssError"><p>'+f+"<\/p><\/div>"))})})};var t=function(t,u,f){var o=u.feed,e,a,p,v,l,s,y,b,h,c;if(!o)return!1;for(e="",a="odd",f.media&&(p=r(u.xmlString),v=p.getElementsByTagName("item")),f.header&&(e+='<div class="rssHeader"><a href="'+o.link+'" title="'+o.description+'">'+o.title+"<\/a><\/div>"),e+='<div class="rssBody"><ul>',l=0;l<o.entries.length;l++){if(s=o.entries[l],s.publishedDate&&(y=new Date(s.publishedDate),b=y.toLocaleDateString()+" "+y.toLocaleTimeString()),s.link="/extn/news/article/"+s.link.split("&id=")[1],e+='<li class="rssRow '+a+'"><'+f.titletag+'><a href="'+s.link+'" title="View this feed at '+o.title+'">'+s.title+"<\/a><\/"+f.titletag+">",f.media&&v.length>0){if(h=v[l].getElementsByTagName("enclosure"),h.length>0){for(e+='<div class="rssMedia"><div>Media files<\/div><ul>',c=0;c<h.length;c++){var w=h[c].getAttribute("url"),k=h[c].getAttribute("type"),d=h[c].getAttribute("length");e+='<li><a href="'+w+'" title="Download this media">'+w.split("/").pop()+"<\/a> ("+k+", "+i(d)+")<\/li>"}e+="<\/ul><\/div>"}e+="<\/li>"}a=a=="odd"?"even":"odd"}e+="<\/ul><\/div>";n(t).html(e);n("a",t).attr("target",f.linktarget)}})(jQuery)