/************************************
/	Quotes Module
/
/	Purpose: display random quotes.
/
/	Dependancies: MooTools Core
/
/************************************/


quotes = new Array();
/*quotes[0] = "It's superb here. And special!";
quotes[1] = "This was the best place to stay!";
quotes[2] = "The extras that you provided for us really helped our stay here. And your greetings and kindness created a relaxed climate.";
quotes[3] = "Thanks to Twin Gables for your hospitality and friendliness. Wonderful inn!";
quotes[4] = "It was lovely and just the retreat I needed. Thanks for being such angels.";
quotes[5] = "Twin Gables, you rock!";
quotes[6] = "Great place, great people - the best place.";
quotes[7] = "What a wonderful place. Would return and recommend to friends.";
quotes[8] = "We had such a wonderful stay! Looking forward to coming back in the near future";
quotes[9] = "Thank you for a wonderful home away from home.";
quotes[10] = "Thanks for a lovely, restorative stay!";
quotes[11] = "We had an awesome time!!! Twin Gables was the best and Woodstock is so much fun!";

quotes[] = "\"<br><br>";
*/

quotes[0] = "\"Sad to leave, but so happy to have stayed.\"<br><br>---Claire and John/ Perth Australia";
quotes[1] = "\"We loved room #10- quiet, clean, comfortable and quaint!\"<br><br>---Lois & Irwin/ Syosset, NY";
quotes[2] = "\"Comfy, quiet room with tons of space!\"<br><br>--- Debby & Brooks / Greensboro, NC ";
quotes[3] = "\"The woods & creeks around town drew us back to a place we all need to be- peaceful & with nature.\"<br><br>--- Debby & Brooks / Greensboro, NC ";
quotes[4] = "\"Your accommodations are very clean and well-appointed.\"<br><br> ---J and J/  Brooksville, Maine ";
quotes[5] = "\"Your greetings and kindness crated a relaxed climate.\"<br><br> ---J and J/ Brooksville, Maine ";
quotes[6] = "\"What a wonderful place. Would definitely return and recommend to friends.\"<br><br> -- Elizabeth and Craig, Churubusco, NY ";
quotes[7] = "\"We had such a wonderful stay! Looking forward to coming back in the near future.\"<br><br>-- Lois and Irwin, Syosset, NY";
quotes[8] = "\"We were able to relax here, which we really needed\"<br><br>-- Debby and Brooks, Greensboro, NC  ";
quotes[9] = "\"Wonderful and peaceful time. Great hospitality.\"<br><br> --- Deepak and Manu, Raashi/ India ";
quotes[10] = "\"We enjoyed our stay in Room 10 coupled with excellent hospitality\"<br><br>--- Deepak and Manu, Raashi/ India";
quotes[11] = "\"What a wonderful place to escape to! Will definitely return.\"<br><br>--- Karen/ Bergen County, NJ ";
quotes[12] = "\"This was a fabulous 50th birthday weekend with some wonderful friends. I am truly blessed. \"<br><br>--- Maureen / Valley Cottage, NY";
quotes[13] = "\"Nice hotel, lovely room, and nice staff!\"<br><br> --- Veerle & Free/ Amsterdam ";
quotes[14] = "\"We loved Room 10. We slept so well! And everything was perfect!\"<br><br>--- Sebastian, May, Sue / Madrid, Spain ";
quotes[15] = "\"We really enjoyed how personable and welcoming everyone was here.\"<br><br>---Matthew & Joni/ Philadelphia, PA ";
quotes[16] = "\"Very pleasant stay. We loved the room and the staff.\"<br><br>---Sharon & Don/ NJ ";
quotes[17] = "\"Very comfortable, clean and great vibrations- thank you so much\"<br><br>---Sharon & Don/ NJ ";
quotes[18] = "\"I love the improvements the new owner has made!\"<br><br>---Brenda/ NYC ";
quotes[19] = "\"Thanks so much for the home away from home.\"<br><br>---Bob & Cindy/ Moline, Indiana ";
quotes[20] = "\"I simply adore room 3- it's cozy, charming, clean and comfortable. I plan to be back again and again.\"<br><br>--Carmella/ NYC";
quotes[21] = "\"Spent our 1 year anniversary here and LOVED the new room 12.\"<br><br>--Christine & Pat/ NYC ";
quotes[22] = "\"It's superb here. And special!\"<br><br>---Jack/ Sydney, Australia ";
quotes[23] = "\"The extras that you provided for us really helped our stay here. And your greetings and kindness created a relaxed climate.\"<br><br>---J and J/  Brooksville, Maine";
quotes[24] = "\"Thanks to Twin Gables for your hospitality and friendliness. Wonderful inn!\"<br><br>-- J, J, M and P – New York City";
quotes[25] = "\"It was lovely and just the retreat I needed. Thanks for being such angels.\"<br><br>-- Pat D.";
quotes[26] = "\"Great place, great people - the best place.\"<br><br>----Paola and Alberto/ Milan, Italy";
quotes[27] = "\"What a wonderful place. Would definitely return and recommend to friends.\"<br><br>--- Elizabeth and Craig /Churubusco, NY ";
quotes[28] = "\"This home, this room, the people here are fantastic.\"<br><br>---Christoph & Katharina/ Hannover, Germany ";
quotes[29] = "\"We came here for a weekend getaway from our busy lives and couldn’t have asked for more.\"<br><br>---Hunter & Polly/ Bronx, NY ";
quotes[30] = "\"We have spent two days here on our trip round New York for our honeymoon and had such a lovely stay here…We are sad to leave!\"<br><br>---Rich & Sue/ Manchester, UK ";
quotes[31] = "\"The Twin Gables has been the best place to stay for over 40 years. The rooms and bathrooms are clean and cared for.\"<br><br>---Abbey/ Los Angeles, CA ";



var quoteCycler = new Class({
	initialize:  function(q, t) {
		this.quotes = new Array();
		this.quotes = q;
		this.lastQuoteIndex = null;
		
		this.target = $(t);
		this.fader = new Fx.Tween(this.target, {duration: 1000, link: 'chain'});
		this.fader.addEvent('complete', this.getQuote.bindWithEvent(this));
		this.initQuote();
	},
	
	initQuote: function() {
		quoteNum = $random(0, this.quotes.length-1);
		this.target.innerHTML = this.quotes[quoteNum];
		this.lastQuoteIndex = quoteNum
	},
	
	getQuote: function() {
		if (this.target.getStyle('color') == '#ffffff') {	// only change quote when it is not 'visible'.
			while( (quoteNum = $random(0, this.quotes.length-1)) == this.lastQuoteIndex){};	// don't show the same quote consecutivly.
			this.target.innerHTML = this.quotes[quoteNum];
			this.lastQuoteIndex = quoteNum
		}
	},

	cycle: function() {
		this.fader.start('color', '#ffffff');
		this.fader.start('color', '#807352');
	}
});


window.addEvent('domready', function() {
	var tgQuoteCycler = new quoteCycler(quotes, "quoteDisplay");
	tgQuoteCycler.cycle.periodical(7000, tgQuoteCycler);
});







 











