// JavaScript Document

// WEBSITE SELECT DROPDOWN

window.addEvent ('domready', function () {

	$('websiteselect').addEvent ('change', function () {
		window.open($('websiteselect').get ('value'));
	});

});

window.addEvent ('domready', function loadAccordion() {
	var accordion = new Accordion ('h4.atStart', 'div.atStart',
		{
			opacity: true,
			onActive: function (toggler, element) {
				toggler.setStyle('color', '#DC6E1E');
			},
			
			onBackground: function(toggler, element) {
				toggler.setStyle('color', '#DC6E1E');
			},
			alwaysHide: true,
			// Quirck: To force that the first element is not being collapsed
			display: 9999
		},
		$('faq')
	);
});

window.addEvent('domready',fillSelects);
function fillSelects(){
	//  productsoort
	if(!$('faq_search')){
		return
	}
	var theSelect = new Element('select',{ 'name'		: 'faq_cat',
										   'id'  		: 'faq_cat',
										   'tabindex'	: '1'						
											});
	$$('#faq_cat_ul li').each( function(theEle){
		var theOption = new Element('option',{
				'value': theEle.getFirst().getProperty('href'),
				'selected': theEle.getFirst().hasClass('current')?true:false
			}
		);
		theOption.appendText(theEle.getFirst().get('text'));
		theOption.injectInside(theSelect);
	});
	theSelect.replaces($('faq_cat_ul'));
}
