$(document).ready(function(){
	var refCount = $('#sidebar-reference a').length;
	var fodCount = $('#sidebar-founder a').length;
	
	
	var nextRef = 0;
	var nextFod = 0;
	
	switchRef = function() {	
		$($('#sidebar-reference a').get(nextRef)).fadeOut(1000);
		nextRef = (++nextRef == refCount) ? 0 : nextRef;
		$($('#sidebar-reference a').get(nextRef)).fadeIn(1000);
		setTimeout('switchRef()', 3500);
	}
	
	switchFounder = function() {	
		$($('#sidebar-founder a').get(nextFod)).fadeOut(1000);
		
		nextFod = (++nextFod == fodCount) ? 0 : nextFod;
		
		$($('#sidebar-founder a').get(nextFod)).fadeIn(1000);
		
		setTimeout('switchFounder()', 3500);
	}
	
	if(fodCount > 0) switchFounder();
	if(refCount > 0) setTimeout('switchRef()', 1000);
		
	
	$('#accordion').each(function(i,n){		
		var last = null;
		
		$('h3', n).click(function() {
			$(last).next().toggle('slow');
			$(this).next().toggle('slow');
			last = this;
			return false;			
		});		
	});
	
	$('.showmore').click(function(){		
		$(this).hide().next().toggle('slow');
		return false;		
	});
	
	function setTopJumper() {
		var tim= null;
		jump = document.getElementById("top");
		if(jump)  {
			jump.onmouseover = function() {tim = setTimeout("window.scrollTo(0,0)",200);}
			jump.onmouseout = function() {clearTimeout(tim);}
		}
	}
	setTopJumper();
	
});

$(function() { $("a").focus(function() { $(this).blur() }) })
