// JavaScript Document

function cliktThis (o) {
	// if the element is a link, don't animate - just go to the page
	if (o.hasClass('extLink')) {
		var extLink = o.attr('extlink');
		window.open (extLink, "_blank");
	} else if (o.hasClass('linkable')) {
		window.location = o.attr('extlink')!=undefined ? o.attr('extlink') : 'index.php?p=folk&id='+o.attr('obj');
	// otherwise, animate!
	} else {
		if (o.parent().hasClass('tier1')) {
			o.addClass('on');
			$('div.accordionMenu>h3').not(o).removeClass('on');
		}
		o.next('div.content').slideToggle('fast').siblings('div.content:visible').slideUp('fast');
	}
}

function prop (o) {
	if (!(o.hasClass('tier1'))) {
		o.next().show();
		o.addClass('on');
		(o.hasClass('content')) ? prop(o.prev()) : prop(o.parent());
	}
}

$(document).ready(function() {
		firstOpen = $('h3[obj="'+openID+'"]');
		$('div.accordionMenu>div.content').hide();
		prop(firstOpen);
		$('div.accordionMenu>h3').click(
			function() {
				cliktThis($(this));
       			}
       		).hover(
       			function() {
       				$(this).addClass('hover');
       			},
       			function() {
       				$(this).removeClass('hover');
       			}
       		);
		
		
		
		////
		//$('h3').click(function(){
			
		//});
		////
		
		
		
		
});







///////////////




