$(document).ready(function() {
	
	// dropdown menu
	$('li.dropdown').hover(
		function () {
			$('ul', this).show();
		},
		function () {
			$('ul', this).hide();
		}
	);
	
	// disable clicking of drop down links
	$('li.dropdown > a').click(function() {
		return false;
	});
	
	
	// animate the divs in the logo list
	$('ul#logos li').hover(
		function () {
			$('div', this).animate({ bottom: 0 }, 300);
		},
		function () {
			$('div', this).animate({ bottom: -130 }, 300);
		}
	);
	
	
	// align the logos vertically in the div 
	$('ul#logos li').each(function() {
		var liHeight = $(this).height();
		var imgHeight = $('img', this).height();
		var marginHeight = (liHeight - imgHeight)/2;
		$('img', this).css({ 'margin-top' : marginHeight });
	});
	
	
	$('ul#logos li div a').click(function() {
								   
		var selector = $(this).attr('selector');
		
		$('#companies div').hide();
		$('#companies .' + selector).fadeIn('fast');
		
		return false;
	});
	
	$('ul#logos li div').mouseenter(function() {
		$('#companies div').fadeOut();
	});
	

});
