/* Javascript voor plugin Producten */
new Event.observe(window,'load',function(){
	// accordion.js gebruiken
	var options = {
		classNames : {
						toggle : 'product-titel',
						toggleActive : 'actief',
						content : 'product-tekst'
					},
		'direction' : 'vertical'
	};
	new accordion('producten', options);
	
	// categorieen kiezen
	$$('ul.themas li a').each(function(item){
		if(item.id.length > 0){
			
			item.observe('click',function(){
				$$('ul.themas li a').each(function(a){	
					if(a.id.length > 0)
						a.setStyle({'fontWeight':'normal'});
				});
			
				// markeer de goede
				this.setStyle({'fontWeight':'bold'});
				var cat = this.id.split('-')[1];
				if(cat != 'allen'){
					$$('div.producten div.product-titel').invoke('addClassName','inactief');
					$$('div.producten div.product-titel.'+cat).invoke('removeClassName','inactief');
				}else{
					$$('div.producten div.product-titel').invoke('removeClassName','inactief');
				}
				
			});
			item.onclick = function(){return false;}
		}
	});

});
