
  var general = new function(){

    var jar = null;

    this.init = function() {

      jar = new CookieJar({
        expires: 2592000,
        path: '/'
      });

      if(/affId=([^&]+)/.test(window.location.href)) {
        storeCookie(/affId=([^&]+)/.exec(window.location.href)[1]);
      }
      else if(readCookie()) {
        $('phone').hide();
      }
      else {
        $('phone').show();
      }
    }

    function storeCookie(affiliateId) {
      jar.put('cruising', {id: affiliateId});
    }

    function readCookie() {
      return jar.get('cruising') != null;
    }
  }

  Event.observe(window, 'load', general.init);