

function ShadowboxExtras() {
  this.show = function() {
    Shadowbox.init({
      onOpen: function() {
        j('#sb-body').append(j('#sb-title').show());
        this.hide();           
      },
      onChange: function() {
        j('#sb-title-inner').hide();
      },
      onFinish: function() {
        j('#sb-title-inner').width(j('#sb-wrapper-inner').width()-30);
        this.hide();
      },
      hide: function() {
        j('#sb-title-inner').each(function() {
          var txt = j.trim(j(this).text());
          if(txt == '') {
            j(this).hide();
          }else {
            j(this).show();
          }
        });
      }
    });      
  } 
}

function Roadblock() {         
  
  this.content = function() {
    var html =  '<div id="roadblock">'+
                  '<a id="rb-close" onclick="Shadowbox.close()"></a>'+
                  '<a id="rb-button" href="/emailform/" ></a>'+
                '</div>';                  
    return html;
  }
  
  this.show = function() {
    Shadowbox.init({skipSetup: true});
    var html =  this.content();     
    Shadowbox.open({
      content: html,
      player: 'html',          
      width: 600,
      height: 400
    });      
  }
  
  this.viewed = function() {
    if(j.cookie('roadblock')=='true') {
      return true;       
    }else {
      j.cookie('roadblock', 'true', {expires: 365});
      return false;
    }    
  }

// EOF     
}


