flexPay = {
	
	testimonials: true,
	
	dropdown_menus: $A(),
	
	reveal: function(event)
	{
		var element = event.element();
		var classes = $w(element.className);
		var className = classes.without('reveal','revealed','andHighlight')[0];
		
		var els = $$('div.'+className,'p.'+className);
		
		els.invoke('toggle');
		element.toggleClassName('revealed');
		
		
		if(classes.indexOf('andHighlight'))
		{
			els.each(function(el)
			{
				new Effect.Highlight(el);
			})
		}
		
		event.stop();
		
	}
}

flexPay.init = function()
{
	var dropdownXOffset = -2;
	var dropdownYOffset = 0;
	
	this.dropdown_menus.push(new DFThemeObject.DropdownMenu({
		xOffset:dropdownXOffset,
		yOffset:dropdownYOffset,
		source:[
			{text:'Meet Our Team',href:'/team.html'},
			{text:'Career Opportunities',href:'/jobs.html'}
		],
		applyTo: $('pageLink_about').down()
	}));
	
	this.dropdown_menus.push(new DFThemeObject.DropdownMenu({
		xOffset:dropdownXOffset,
		yOffset:dropdownYOffset,
		source:[
			{text:'FAQs',href:'/faq.html'}
		],
		applyTo: $('pageLink_support').down()
	}));
	
	/*
	this.dropdown_menus.push(new DFThemeObject.DropdownMenu({
		xOffset:dropdownXOffset,
		yOffset:dropdownYOffset,
		source:[
			{text:'Section 125 Plan',href:'client_resources.html#section125'}
		],
		applyTo: $('pageLink_resources').down()
	}));
	
	var fixDropdowns = function() {
		this.dropdown_menus[this.dropdown_menus.length-1]._els.outer.setStyle({width:'138px'});
	}.bind(this);
	fixDropdowns.delay(1.5);
	*/
	
	if(this.testimonials)
	{
		var list = $('rightnav').down('div.testimonials ul');
		
		if(list)
		{
			new Ajax.Updater(list,'/testimonials_content.html',{
				method: 'get',
				onComplete: function()
				{
					new JRandomContent($('featured_testimonial'),{sourceList:list});
				}
			});
		}
	}
	
	$$('a.reveal').invoke('observe','click',this.reveal);
	
}.bind(flexPay);


FastInit.addOnLoad(flexPay.init);
