var quoteOn = false;

function showQuote() {
	if(quoteOn) return;
	
	//else
	$('fullquote').style.opacity =  0.0;
	$('fullquote').style.display = 'block';	
	new Effect.Opacity('fullquote', {duration:0.5, from:0.0, to:1.0});	
	//new Effect.Appear('fullquote');
	//$('fullquote').style.opacity =  1.0;	
	quoteOn = true;
	alignQuote();
}

function hideQuote() {
	new Effect.DropOut('fullquote');
	//$('fullquote').style.display = 'none';
	quoteOn = false;
}

function alignQuote () {
	if (!quoteOn) return;
	//else
	fq = $('fullquote');
	rm = $('readmore');
	oT = rm.offsetTop;
	oL = rm.offsetLeft;
	par = 'BODY';
	el = rm;
	while (el.offsetParent.tagName !='BODY') {
		el = el.offsetParent;
		oT += el.offsetTop;
		oL += el.offsetLeft;
		par += '/' + el.offsetParent.tagName;
	}
	fq.style.top = oT - fq.offsetHeight + 10+'px';
	fq.style.left = oL + rm.offsetWidth +'px';	
}


if (typeof(juxtaproseAddWindowOnLoad) != 'function') {

	var juxtaproseAddWindowOnLoad = function(func) {
		var holdonload = window.onload;
		window.onload = function() {
			if (typeof(holdonload)=='function') holdonload();	
			func();
		}
	}
}


juxtaproseAddWindowOnLoad(function() {

	new Insertion.Bottom('quotezone', '<a href="javascript:showQuote()" onmouseover="showQuote()" id="readmore">read more</a>');
	
	new Insertion.Top('fullquote', '<a href="javascript:hideQuote()">pop my balloon [x]</a>');

new Insertion.Bottom('fullquote', '<a href="javascript:hideQuote()">[x]</a>');

	window.onresize = alignQuote;	
});
