/* 
RELEVANT HTML:
<a class="red" href="#" onclick="return toggleInterstitial('t',event);">What is this?</a>
<div id="quote_container" style="display:none;"></div>

RELEVANT CSS:
<style type="text/css">
#quote_container{
  	float:left;
  	border: 1px solid #010101;
	background: #FCFAE4; !important
	height: 129px;
	width: 362px;
	padding: 0 0 0 10px;
	position: absolute;
	z-index: 10000;
	text-align: left;
	left: 25%;
	Xtop: 330px;
	display: block;
}
</style>
*/


/* QUOTE */

var quoteArray = new Array(
	'<div id="quote"addock + purcell have done the impossible by making the residential real estate process fun and engaging for me as a first-time homebuyer. From finding a savvy and sensitive Westchester-based real estate broker to introducing me to a phenomenal mortgage broker, working with braddock + purcell translates to having powerful friends in real estate who care about you before, during and after the deal is done.</div><div id="author">&ndash; Lisa MItchel, Executive, UPS</div>',
	'<div id="quote">Last year I decided it was time to take the plunge into home ownership. Being a first time home buyer was intimidating enough as a concept, let alone the fact that I was going to be embarking on this adventure in New York City. Because of their expertise the entire process was demystified, from looking for the perfect apartment, getting the financing together, to deciphering the Coop Board process, it was all far more manageable then if I had tackled this on my own. Braddock + Purcell even helped me when it was time to select a contractor for the work that needed to be done in the apartment to make it my own!</div><div id="author">&ndash; Karie R, Jabe, VP/Director of Recruiting & Training, Thomson Learning</div>',

	'<div id="quote">The service we have received from braddock + purcell has been top class throughout the process. The decision not to buyis as significant as to buyand you have provided objective, helpful advice all along. We have enjoyed meeting each of the contacts you have put us in touch with and you were well tuned in to our needs. We will certainly be passing on strong recommendations to others that we speak to about real estate investing.</div><div id="author">&ndash; Paul Carter, Boston Consulting Group</div>'

	'<div id="quote">Having just used the services of braddock + purcell, I can’t say enough about the help they provided me throughout the entire process of my apartment purchase in Manhattan. From our initial conversation where braddock + purcell gave me a comprehensive overview of the real estate market in NYC, to recommending a fantastic broker, to asking all of the questions I didn’t know to ask in my first walk, b + p has been my primary source of reliable information and trustworthy advice. Frankly, they were an invaluable resource and I strongly recommend that anyone looking at a potential purchase of property within NYC give b + p a call. They were simply fantastic!</div><div id="author">&ndash; Greg Parsons, McKinsey & Company </div>'

	'<div id="quote">The residential real estate industry can be enormously frustrating to the consumer. In my lifetime the level of careI’ve received from various residential real estate brokers has varied widely, and I’ve been frequently disappointed about the general lack of professionalism in the industry. I look to braddock + purcell as expert residential real estate guides who’ll ensure that the process of selling my Chelsea loft is seamless, secure, efficient and pain-free.</div><div id="author">&ndash; John Podesta, Apparel Industry Executive </div>'

	'<div id="quote">When I learned I could reach out to the experienced talent of braddock + purcell at no additional cost, I was ecstatic. I was amazed that I was able to have complete, unfettered access to Paul Purcell, a residential real estate professional with outstanding credentials and background. For real estate brokers, mortgage brokers and real estate attorneys, purchasing property is an everyday occurrence. braddock + purcell understand that for individual people, purchasing property is a huge decision with significant lifetime ramifications./div><div id="author">&ndash; Kevin Molloy, Vice President, AXA Financial </div>'

	'<div id="quote">If you’re thinking of buying or selling residential real estate in the New York City area, your first stop should be braddock + purcell. As your advocate, they provide clients with a value that is priceless: informed, intelligent, and unbiased information that streamlines the process and makes you feel like a real estate expert. Having used them for simultaneously selling and purchasing apartments, their business acumen and professional hand-holding made both deals happen without a lot of stress. I can’t recommend their services enough and wouldn’t think of working without them in the future. </div><div id="author">&ndash; Ken Lustbader, Historic Preservation Consultan </div>'

	'<div id="quote">Faced with the daunting task of moving to NYC and coming to grips with the complexity of the Manhattan property market, the discovery of braddock + purcell was like finding a port in a storm. Their knowledge and experience of the market was invaluable and they are genuinely interested in working out what is right for the client and then helping them through the process. Being a skeptical Brit (Scot), at first I was expecting to find a catch. There is none. This is truly an independent and impartial service that anyone looking to buy or rent property in NYC would be mad not to take advantage of. I cannot recommend them highly enough.</div><div id="author">&ndash; Lynda Logan, SVP, Wood Mackenzie Consultants </div>'
);
var quoteCount = quoteArray.length;
function generateRandom(){
	var myRandom = Math.round(100*Math.random());
//	var myRandom = 100;
	var myFraction = 100/quoteCount;
//	alert("myRandom: "+myRandom+"/"+myFraction);
	var firstQuote = Math.round(myRandom/myFraction) - 1;
//	alert("firstQuote: "+firstQuote);
	return firstQuote;
}
var currentQuote = generateRandom();
//alert("CurrentQuote: "+currentQuote);
//alert("Quote: "+(currentQuote+1) + "/" + quoteCount);


new Effect.Appear('quote_container'); 
function startNextQuoteRotation(){
	setTimeout("showNextQuote();startNextQuoteRotation()",20000);
}

function showNextQuote(){
	var quote_container = document.getElementById('quote_container');
	if (currentQuote + 1 == quoteCount) {
		currentQuote = 0;
	} else {
		currentQuote++;
	}
	new Effect.myFade('quote_container'); 
	return false;
}
var text = "";

Effect.myFade = function(element) {
//	alert(contactIDTarget);
  var oldOpacity = Element.getInlineOpacity(element);
  var options = Object.extend({
  from: Element.getOpacity(element) || 1.0,
  to:   0.0,
  afterFinishInternal: function(effect) { with(Element) { 
    if(effect.options.to!=0) return;
//    hide(effect.element);
	
	var quote_text = document.getElementById('quote_text');
	var text="xxx";
	text=quoteArray[currentQuote];
	quote_text.innerHTML = text;
	new Effect.Appear('quote_container'); 

//    showQuote(quote, e)
//    setStyle(effect.element, {opacity: oldOpacity}); 
    }}
  }, arguments[1] || {});
  return new Effect.Opacity(element,options);
}

var opacityLevel = 1;
function hideQuote(){
	targetResults = 'results' + contactIDTarget;
//	Effects.Fade(targetResults,{duration:2.0, from:1.0, to:0.1});
	new Effect.myFade(targetResults,event);
}

showNextQuote();
startNextQuoteRotation();
