function AppObj(app) {
  this.app = app;
  var _app = app;
  
  this.getTitle = function() {
    if (_app.title) {
      return _app.title;
    }
    var title = _app.id;
    var first = title.charAt(0).toUpperCase();
    return first + title.substring(1);
  };
  
  this.getWeb = function() {
    if (_app.noWeb) {
      if (_app.noWeb == "1") {
        return null;
      }
      return "http://" + _app.noWeb;
    }
    return "http://" + _app.id + ".speedymarks.com";
  };

  this.getIPhone = function() {
    if (_app.iphone) {
      return "http://itunes.apple.com/app/id" + _app.iphone;
    }
    return null;
  };

  this.getIPad = function() {
    if (_app.ipad) {
      if ((_app.ipad + "") == 1) {
        return this.getIPhone();
      }
      return "http://itunes.apple.com/app/id" + _app.ipad;
    }
    return null;
  };

  this.getAndroid = function() {
    return this.getAndroidLink(_app.android);
  };
  
  this.getAndroidFree = function() {
    return this.getAndroidLink(_app.androidFree);
  };
  
  this.getAndroidLink = function(code) {
    if (code) {
      if (code == "1") {
        return "http://market.android.com/details?id=com.speedymarks.android." + _app.id;
      }
      if (code.indexOf("com.") == 0) {
        return "http://market.android.com/details?id=" + code;
      }
      return "http://market.android.com/details?id=com.speedymarks.android." + _app.id + code;
    }
    return null;
  };

  this.getPalm = function() {
    if (_app.palm) {
      return "http://developer.palm.com/appredirect/?packageid=com.speedymarks.palmpre." + _app.id;
    }
    return null;
  };

  this.getPalmPad = function() {
    if (_app.palmPad) {
      return "http://developer.palm.com/appredirect/?packageid=com.speedymarks.palmpad." + _app.id;
    }
    return null;
  };

  this.getMicrosoft = function() {
    if (_app.wp7) {
      //return "http://redirect.zune.net/redirect?type=phoneApp&source=Pairs&id=" + _app.wp7;
      return "http://windowsphone.com/s?appid=" + _app.wp7;
    }
    return null;
  };

  this.getBlackBerry = function() {
    if (_app.pBook) {
      return "http://appworld.blackberry.com/webstore/content/" + _app.pBook;
    }
    return null;
  };

  this.getIcon = function() {
    return _app.id + "Icon.png";
  };
  
  this.toString = function() {
    return this.getTitle();
  };
  
}

