// JavaScript Document

Window.onDomReady( 


function(){

var questions = $$('.question'); // replaces the pair below
var answers = $$('.answers');

// getElementsByClassName is a function from prototype. (also found in MOOTOOLS)
// var questions = document.getElementsByClassName('question');
// var answers = document.getElementsByClassName('answers');

// each can replace the forEach statement (also in prototype)
questions.each(function(question, i){
	question.effect = new Fx.Slide(answers[i], {duration: 100, onComplete: function(){
		if (this.element.getStyle('margin-top') == '0px') this.wrapper.setStyle('height', 'auto');
		// alert(this.element.getStyle('margin-top')+' is this.element\'s margin-top \n'+this.wrapper.getStyle('height')+' is this.wrapper\'s height!');
		// alert(this.element.getStyle('margin-top')+' is this.element\'s margin-top \n'+this.wrapper.getStyle('height')+' is this.wrapper\'s height!');
		}, 
		onStart: function(){question.toggleClass('bubba');}
		}).hide();
// This Fx.Slide bizness has some print probs in FF... (doesn't push to 2nd page of content - Feb 14, 2007
// This Slide.Fx bizness has a print issue in Opera... (doesn't show all the open slide) - Feb 16, 2007

// Fx.Slide Properties::
// slideIn: slides the elements in view horizontally or vertically, depending on the mode parameter or options.mode.
// slideOut: slides the elements out of the view horizontally or vertically, depending on the mode parameter or options.mode.
// hide: Hides the element without a transition.
// show: Shows the element without a transition.
// toggle: Slides in or Out the element, depending on its state

// if (i==1 || i==0 || i==11) { // to force open a specific area (could .php later?)
// question.effect.toggle();
// };
	
	question.addEvent('click', function(){
		question.effect.toggle();
	});

	} // closes questions.each
	
	); //closes  function (questions.forEach)


var mySmoothScroll = new SmoothScroll({duration: 3000});
// var myTips = new Tips($$('.toolTipElement'), {
// 	timeOut: 700,
// 	maxTitleChars: 50, /*I like my captions a little long*/
// 	maxOpacity: .9 /*let's leave a little transparancy in there */
// });

 /* Tips 4 */var tip = new Tips($$('.tip'), {	className: 'custom'});	
	
} //closes main function

); //closes onDom
// window.addEvent('domready', function(){ new SmoothScroll(); });