(new Gallery).addStage("monitorSetting",{header:{prevStage:"flightSetting",backWhole:!1,title:"抢飞机票"},init:function(){$("#buyItFromTicketDetail").click(function(){var n=$(this).attr("_link");Statistics.trigger(16,encodeURIComponent(n),(new Gallery).getCurrentStage());chrome.tabs.create({url:n})});$("#monitorAbsolute,#monitorRelative").click(function(){$("#contentCover").show();var n=FlightFactory.getFromKeeper();$(this).attr("_monitorType")=="absolute"?Statistics.trigger(40,encodeURIComponent(n.getId())):Statistics.trigger(41,encodeURIComponent(n.getId()));chrome.extension.sendRequest({type:"addMonitor",flightId:n.getId(),monitor:{type:$(this).attr("_monitorType"),price:n.data.main.price},lastShowedPrice:parseInt(n.data.main.price,10)},function(n){$("#contentCover").hide();n.status!==0?(new Gallery).backTo("flightSetting",!1,n.error):((new FlightMonitorBox).init(),(new Gallery).goTo("monitorBox",!1),InputKeeper.clean())})})},prepare:function(n){var t=InputKeeper.getInfo().type;n===undefined&&(n=FlightFactory.getFromKeeper());Filler.fill($("#ticketSettingDetail"),{query:n.query,ticket:n.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+"折"}},url:function(n){return n.ticket.url+"?"+n.ticket.date+config.urls.kuxunSuffix}});WeatherRetriever.fill($(".monitorSetting .fromGroup"),n.data.main.date);WeatherRetriever.fill($(".monitorSetting .toGroup"),n.data.main.date);Statistics.trigger(2,2)}})