﻿function Quotes() {
  this.items = new Array();
  this.add = function(quote) {
    this.items.push(quote);
  }
  
  this.show = function(el, interval) {
    this.el = document.getElementById(el);
    if (this.el && this.items.length > 0) {
      this.setQuote();
      var instance = this;
      window.setInterval(function() {instance.setQuote()}, interval);
    }
  }
  this.setQuote = function() {
    this.el.innerHTML = this.items[Math.floor(Math.random() * this.items.length)];
  }
}


