$(document).ready(function(){
	
	$('#robotcub').hover(function(){
		$('#speechbubble').show();
	}, function(){
		//Do nothing.
	});

	$('a.show').click(function(event){
		event.preventDefault();
		$('div.hiddencontent', $(this).parents('div.event')).slideDown(1000);
		return false;
	});
	
	$('a.hide').click(function(event){
		event.preventDefault();
		$(this).parents('div.hiddencontent').slideUp(1000);
		return false;
	});
	
	$('div#content a.tothetop').click(function(event){
		event.preventDefault();
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: 0 }, 1000, function(){});
		return false;
	});
	
	$('div#content a.fellows').click(function(event) {
		event.preventDefault();
		var _index = $('div#content a.fellows').index(this);
		var destination = $('div.fellows').eq(_index).offset().top - 15;
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1000, function(){});
		return false;
	});
	
	$('ul.fellows li a').click(function(event) {
		event.preventDefault();
		var _indexUL = $(this).parents('ul.fellows').index('ul.fellows');
		var _numberOfLI = $('ul.fellows:first li').size();
		var _index = $('ul.fellows li a').index(this);
		var destination = $('div.partner', $(this).parents('div.fellows')).eq(_index-(_indexUL*_numberOfLI)).offset().top - 15;
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1000, function(){});
		return false;
	});
	
	$('ul#projects li p.additional').hide();
	
	$('ul#projects li a').toggle(function(){
		$('p.additional', $(this).parents('li')).slideDown(300);
	}, function(){
		$('p.additional', $(this).parents('li')).slideUp(300);
	});
	
	if (jQuery.browser.msie) {
		var _version = parseInt(jQuery.browser.version);
		if(_version == 6 || _version == 7){
			$('#robotcub').hide();
		}
	}

});