
var LW = { 
  which: -1, 
  ratio: 0,
  cover: 1, 

  init: function (partial) { 
    LW.ivl = setInterval("LW.quotes()", 8000); 
    LW.tout = setTimeout("LW.quotes()", 2000); 
    LW.ratio = $('#image').width() / $('#image').height(); 
    if (partial)
      LW.cover = $('#image').width() / $(window).width(); 

    $(window).resize(function () { 
      w = $(window).width() * LW.cover; 
      h = $(window).height();
      r = w/h; 

      if (r > LW.ratio) {
        $('#image').width(w);
        $('#image').height(w/LW.ratio); 
      } else {
        $('#image').height(h); 
        $('#image').width(h*LW.ratio); 
      } 
    });

    $(window).resize(); 
    $('#image').customFadeIn('fast');
  }, 

  quotes: function () { 
    if (LW.which == -1) { 
      LW.which = (LW.which + 1) % 2; 
      $('#quote-' + LW.which).customFadeIn('slow'); 
      return; 
    } 
    $('#quote-' + LW.which).customFadeOut(2500, function () { 
      LW.which = (LW.which + 1) % 3; 
      $('#quote-' + LW.which).customFadeIn(2500);
    }); 
  },

  page: function (name) { 
    clearInterval(LW.ivl); 
    clearTimeout(LW.tout); 
    $('#quote-' + LW.which).hide(); 
    $('body').css('background', 'url("lauren.jpg") fixed no-repeat left #fff'); 
    $('#menus').animate({'right': '+=550px'}, 1000, function () { 
      // $('#' + name).fadeIn('fast');
      $('#' + name).customFadeIn('fast');
    });
  } 
} 

