function Controller(){function e(){r.closeWindow(l.newsDetail)}function t(){function e(e){r.is("news item",e),l.title.text=e.news.titleShort,l.image.image=e.news.imageUrl.medium,l.headline.text=e.news.titleLong,l.author.text=e.news.author,l.date.text=n.unix(e.news.date).format("M MMM YYYY, HH:mm"),l.article.html=e.news.article,_.defer(function(){l.detailScroll.add(Alloy.createController("newsItems",{itemCount:20,feedUrl:Alloy.CFG.feedUrls.newsArchiveRelated.replace("{{id}}",w.id),noHeader:!0,titleText:L("News_RelatedNews")}).getView())})}function t(){}var i=s.signUrl(Alloy.CFG.feedUrls.newsItem.replace("{{id}}",w.id));d.getData({getUrl:i},e,t)}function i(){l.newsDetail.open()}require("alloy/controllers/BaseController").apply(this,Array.prototype.slice.call(arguments)),this.__controllerPath="newsDetail",arguments[0]?arguments[0].__parentSymbol:null,arguments[0]?arguments[0].$model:null,arguments[0]?arguments[0].__itemTemplate:null;var l=this,a={},o={};l.__views.newsDetail=Ti.UI.createWindow({backgroundColor:Alloy.CFG.colors.darkBlue,layout:"vertical",id:"newsDetail"}),l.__views.newsDetail&&l.addTopLevelView(l.__views.newsDetail),l.__views.titleBar=Ti.UI.createView({height:40,top:0,id:"titleBar"}),l.__views.newsDetail.add(l.__views.titleBar),l.__views.backButton=Ti.UI.createView({width:33,height:33,left:12,backgroundImage:"images/iconBack.png",id:"backButton"}),l.__views.titleBar.add(l.__views.backButton),e?l.__views.backButton.addEventListener("click",e):o["$.__views.backButton!click!closeWindow"]=!0,l.__views.title=Ti.UI.createLabel({font:{fontSize:20,fontFamily:Alloy.CFG.fonts.bold},color:Alloy.CFG.colors.white,width:210,height:30,wordWrap:!1,ellipsize:!0,id:"title"}),l.__views.titleBar.add(l.__views.title),l.__views.detailScroll=Ti.UI.createScrollView({layout:"vertical",backgroundColor:Alloy.CFG.colors.white,contentWidth:Ti.UI.FILL,width:Ti.UI.FILL,id:"detailScroll"}),l.__views.newsDetail.add(l.__views.detailScroll),l.__views.image=Ti.UI.createImageView({width:Ti.UI.FILL,height:222,id:"image"}),l.__views.detailScroll.add(l.__views.image),l.__views.headline=Ti.UI.createLabel({font:{fontSize:24,fontFamily:Alloy.CFG.fonts.bold},height:Ti.UI.SIZE,left:12,right:12,top:20,bottom:6,id:"headline"}),l.__views.detailScroll.add(l.__views.headline),l.__views.labelWrapper=Ti.UI.createView({height:Ti.UI.SIZE,top:6,bottom:6,id:"labelWrapper"}),l.__views.detailScroll.add(l.__views.labelWrapper),l.__views.author=Ti.UI.createLabel({font:{fontSize:16,fontFamily:Alloy.CFG.fonts.default},color:Alloy.CFG.colors.lightGreen,right:12,width:140,textAlign:Ti.UI.TEXT_ALIGNMENT_RIGHT,id:"author"}),l.__views.labelWrapper.add(l.__views.author),l.__views.date=Ti.UI.createLabel({font:{fontSize:16,fontFamily:Alloy.CFG.fonts.default},color:Alloy.CFG.colors.lightGreen,left:12,width:140,id:"date"}),l.__views.labelWrapper.add(l.__views.date),l.__views.article=Ti.UI.createLabel({font:{fontSize:16,fontFamily:Alloy.CFG.fonts.default},height:Ti.UI.SIZE,left:12,right:12,top:8,bottom:20,id:"article"}),l.__views.detailScroll.add(l.__views.article),a.destroy=function(){},_.extend(l,l.__views);var r=require("helpers"),n=require("alloy/moment"),s=require("feedSigner"),d=require("netConnect"),w=arguments[0]||{};a.openWin=i,t(),o["$.__views.backButton!click!closeWindow"]&&l.__views.backButton.addEventListener("click",e),_.extend(l,a)}var Alloy=require("alloy"),Backbone=Alloy.Backbone,_=Alloy._;module.exports=Controller;