var Quote = new Class(
{
	options:
	{
		quote: ''
		, excerpt: ''
		, author: ''
		, position: ''
	}

	, initialize: function(options)
	{
		this.setOptions(options);
		this.quote = this.options.quote;
		this.excerpt = this.options.excerpt;
		this.author = this.options.author;
		this.position = this.options.position;
	}
});
Quote.implement(new Options);

var Quotes = new Class(
{
  options:
  {
      container: 'quotes'
      , className: 'quote'
      , tag: 'p'
      , id: 'quote'
      , quotes: true
      , titleWithAuthor: false
	, excerpt : false
  }

  , initialize: function(options)
  {
		this.setOptions(options);
		this.applyQuotes();
	}

	, applyQuotes: function()
	{
		//calculate a random index
		quote = quotes[$random(0, quotes.length-1)];

		var container = new Element('div', {id: this.options.id}).addClass(this.options.className);

		if (this.options.excerpt)
		{
			if (this.options.quotes) quote.excerpt = '"' + quote.excerpt + '"';
			container.adopt(new Element(this.options.tag, {id: this.options.container + '_quote'}).set('html', quote.excerpt));
		}
		else
		{
			if (this.options.quotes) quote.quote = '"' + quote.quote + '"';
			container.adopt(new Element(this.options.tag, {id: this.options.container + '_quote'}).set('html', quote.quote));
		}
		author = new Element(this.options.tag, {id: this.options.container + '_author'}).set('html', quote.author);
		title = new Element(this.options.tag, {id: this.options.container + '_title'}).set('html', quote.position);
		if (this.options.titleWithAuthor)
		{
		    author.appendText(', ');
		    titleAuthorContainer = new Element('div', {id: this.options.id + '_title_author'}).adopt(author).adopt(title);
		    container.adopt(titleAuthorContainer);
	    }
	    else
	    {
	        container.adopt(author);
	        container.adopt(title);
	    }

		$(this.options.container).adopt(container);
	}
});
Quotes.implement(new Options, new Events);

//store the quotations in objects
quotes = [
	new Quote({
		quote: "Century Solutions Group provides technical support with outstanding customer service! The experts at Century provide assistance for our technological needs and we are always impressed. We receive prompt service and thorough consultations. Century's expertise is crucial to our success!"
		, excerpt: "We receive prompt IT support and thorough consultations for all our technical needs. Century's expertise is crucial to our success!"
		, author: "Lisa Jones"
		, position: "Solutions Realty Network"
		})
	, new Quote({
		quote: "Century Solutions Group has serviced John D. Stephens, Inc., for the past 10 + years. Having multiple divisions and locations, Century has always supported our software and hardware needs. Our moves have always been seamless and without incident, thanks to Century. We wouldn't trust our network to anyone else."
		, excerpt: "For 10 + years Century has supported our IT needs in multiple divisions and locations. Our moves have always been seamless thanks to Century. We wouldn't trust our network to anyone else."
		, author: "Kathy Campbell"
		, position: "John D. Stephens, Inc."
	})
	, new Quote({
		quote: "Century Solutions Group is far superior to other technical support that we have used. They are accessible, responsive, and extremely competent. Problems are solved in a minimum amount of time."
		, excerpt: "Century Solutions Group is far superior to other technical support that we have used. They are accessible, responsive, and extremely competent. Problems are solved in a minimum amount of time."
		, author: "Susan Lowman"
		, position: "Controller, Inco Services"
	})
	, new Quote({
		quote: "Our relationship with Century Solutions Group has grown along with our business over the years.  Jeff and his team have helped us anticipate our changing IT needs and kept us ahead of the curve.  We receive incredible service and attention.  The solutions that are offered by Century are always in our best interest and with our bottom line in mind.  I wouldn't trust another company with our network support."
		, excerpt: "Our relationship with Century has grown along with our business. They always work with our best interest and bottom line in mind.  I wouldn't trust another company with our network support."
		, author: "Lukas Johnson"
		, position: "CFO Walker Brothers"
	})
	, new Quote({
		quote: "When it came time to replace our out-of-date server we met with a few different companies, but it was Century Solutions who impressed us with their professionalism and knowledge and gave us peace of mind.<br/><br/> They made the migration from the old server to the new server a smooth transition, and ensured everything was working properly before they wrapped up (they had a checklist by every station).<br/><br/> I've been part of server migrations in the past where not every workstation was checked and there would always be at least one or more workstations that did not function properly.<br/><br/> We've also used Century's technical support and it has been superior.<br/><br/>They have fixed everything remotely with no service visits, no downtime.<br/><br/> The team at Century Solutions is strong from both a business and technical perspective and I highly recommend them."
		, excerpt: "When we had to replace our server we met with a few companies but Century impressed us with their professionalism and knowledge and gave us peace of mind. I highly recommend them."
		, author: "Lynn M. Odom"
		, position: "North Georgia Concrete, Inc."
	})
	, new Quote({
		quote: "Jeff, thanks a bundle; I had just opened an email regarding the rebate from Microsoft and was saying, \"hmmm, what's this? Must be something Century did for us!!\"  I don't say it enough, but you guys do a great job for us year round.<br/><br/> I feel that we have the best IT service that can be found."
		, excerpt: "I don't say it enough, but you guys do a great job for us -- year round.<br/><br/>I feel that we have the best IT service that can be found!"
		, author: "Susan Burroughs"
		, position: "Geyer Construction Company"
	})
];