var Vendor = Class.create(Model, {
   finished: false,
   logo: false,
   view: ({
        modelView: function() {
            var vendor = this.object;
            var airport = Page.getInstance().getForm().getIATA("destinationAirport");
            var url = vendor.getUrl() + "&iata=" + airport;

            return new Element("a", {href: url, target: "_blank"})
                .appendChild(
                    new Element("img", {
                        src: vendor.getLogo(),
                        alt: vendor.getName(),
                        title: vendor.getName()
                    })
                ).parentNode;
        }
   }),
   initialize: function() {
   },
   getId: function() {
       return parseInt(this.id);
   },
   getCode: function() {
       return this.code;
   },
   getAirlines: function() {
       return false;
   },
   getAirline: function() {
       if (this.airline) {
          return this._getStorage().getAirlineByCode(this.airline);
       }
       return false;
   },
   isDirect: function() {
       return this.airline ? true : false;
   },
   getLimit: function() {
       return this.limit;
   },
   getLogo: function() {
      return this.logo;
   },
   getName: function() {
       return this.name;
   },
   getUrl: function() {
       var url = "/ppc.php?supplier_id=" + this.getId()
               + "&area=flights&"
               + "redirect=" + encodeURIComponent(this.url);
       return url;
   },
   isFinished: function() {
       return this.finished;
   },
   toString: function() {
       return this.getCode();
   },
   setFinished: function(status) {
       this.finished = status;
   },
   valueOf: function() {
       return this.getCode();
   },
   getPrice: function() {
       if (! this.isDirect()) {
           throw "Vendor isn't direct";
       }
       var prices = this._getStorage().getVendorPrices(this);
       if (prices && prices.length > 0) {
          return prices[0];
       }
       return false;
   }
});