(new Gallery).addStage("ticketNotice",{header:{title:"发现特价机票"},temp:!0,init:function(){$("#ticketBuyItBtn").click(function(){var n=$(this).attr("_link");Statistics.trigger(16,encodeURIComponent(n),(new Gallery).getCurrentStage());chrome.tabs.create({url:n})});$("#ticketContinueBtn").click(function(){Statistics.trigger(18);window.close()})},prepare:function(n){var t=(new FlightMonitorBox).get(n),i=t.flight;t.monitor.type=="absolute"?Statistics.trigger(4,0):Statistics.trigger(4,1);Filler.fill($(".ticketDetailBox,.ticketFaxInfo,.buyItBtn",$(".ticketNotice")),{query:i.query,ticket:i.data.main},{ticket:{date:function(n){return Util.date.formatToShort(Util.date.parse(n.ticket.date))},price:function(n){return"￥"+n.ticket.price+".00"},discount:function(n){return parseInt(n.ticket.discount,10)/10+"折"},zhundian:function(n){return n.ticket.zhundian?n.ticket.zhundian:"-"}},url:function(n){return n.ticket.url+"?"+n.ticket.date+config.urls.kuxunSuffix},flightTime:function(n){var t=n.ticket.launchtime.split(":"),i=n.ticket.landtime.split(":"),r=((i[0]-t[0])*60+(i[1]-t[1])+1440)%1440,u=Math.floor(r/60),f=r%60;return(u!==0?u+"小时":"")+(f!==0?f+"分":"")},ticketTrendExpression:function(n,i){parseInt(n.ticket.price,10)===parseInt(t.lastShowedPrice,10)?i.hide():parseInt(n.ticket.price,10)>parseInt(t.lastShowedPrice,10)?i.addClass("riseTrend").removeClass("fallTrend").show():parseInt(n.ticket.price,10)<parseInt(t.lastShowedPrice,10)&&i.addClass("fallTrend").removeClass("riseTrend").show()}});WeatherRetriever.fill($(".ticketNotice .fromGroup"),i.data.main.date);WeatherRetriever.fill($(".ticketNotice .toGroup"),i.data.main.date);$("#foundStopMonitor").attr("_flightId",i.getId());t.lastShowedPrice=parseInt(i.data.main.price,10);(new FlightMonitorBox).persistenceOne(n)}})