	var timer;
	var timeOutAt;
	var timerRunning;
	timeOutAt = parseInt(200);
	timerRunning = false;

	function fader() {

		var $img = $('.img-holder img.chunk');
		var total = $img.length;
		if (total < 10){
			$img.each(function(index) {
				var rand = Math.floor(Math.random()*6);
				var randDelay = rand*30;
				var randSpeed = rand*400;
				$(this).delay(randDelay).fadeIn(randSpeed);
			});
		}
		else {
			$img.each(function(index) {
				var rand = Math.floor(Math.random()*6);
				var randDelay = rand*80;
				var randSpeed = rand*200;
				$(this).delay(randDelay).fadeIn(randSpeed);
			});		
		}
	}

	function toggleSlider(id) {
		$('#home-grid-holder img').each(function(index){
			if( ! $(this).hasClass('cat-'+id) && ! $(this).hasClass('grayed')) {
				$(this).animate({opacity: .1});
			}
			else
			{
				$(this).animate({opacity: 1});
			}
		});

		if ($('#slide-wrapper .active').size() > 0)
		{
	    	$('#slide-wrapper .active').fadeOut('fast', function(){
	    	  	$(this).css('top', '250px').removeClass('active');
				$('#slider'+id).fadeIn('fast').animate({top : '0px'}, 300, 'swing').addClass('active');
	    	});
	 	}
	  	else 
			$('#slider'+id).fadeIn('fast').animate({top : '0px'}, 300, 'swing').addClass('active');
	}
	function killTimer() {
		if(timerRunning) 
			clearTimeout(timer);
		timerRunning = false;
	}
	function startSlider(id) {
		timer = setTimeout("toggleSlider('"+id+"')",400);
		timerRunning = true;
	}
	function startTimer(id) {
		timer = setTimeout("hideSlider('"+id+"')",200);
		timerRunning = true;
	}
	function hideSlider(id) {
		$('#home-grid-holder img').each(function(index){
	 	  $(this).animate({opacity: 1});
		});
		if ($('#slide-wrapper .active').size() > 0)
		{
	    $('#slide-wrapper .active').fadeOut('fast', function(){
	      $(this).css('top', '250px').removeClass('active');
	    });
	  }
	}

///////- 		Who We Are		 -////////	
	function toggleWhoSlider(id) {
		if ($('.left-who .active').size() > 0){
			$('.left-who .active').fadeOut('fast', function() {
				$(this).removeClass('active');
				$('#who-slider'+id).fadeIn('fast').addClass('active');
			});
		}
		else {
			$('#who-slider'+id).fadeIn(200).addClass('active');
		}
	}

	function hideWhoSlide(id) {
		if ($('.left-who .active').size() > 0){
			$('.left-who .active').fadeOut('fast', function() {
				$(this).removeClass('active');
				$('#who-slider0').fadeIn('fast').addClass('active');
			});
		}
	}
$(document).ready(function() {

	fader();
	
	$('ul#nav li.parent').hover(
		function(){ 
			$('a.parent').addClass('active');
 			$('ul#subnav').show();
			},
		function(){
			$('a.parent').removeClass('active') 
 			$('ul#subnav').hide();
			});
	
	$('.slide-link').mouseover(function() {
		var id = ($(this).attr('id')).replace('slide-', '');
		killTimer();
		startSlider(id);
		$(this).addClass('slid'+id);
	});
	
	$('.slide-link').mouseout(function() {
		var id = ($(this).attr('id')).replace('slide-', '');
 		killTimer();
 		startTimer(id);
 		$(this).removeClass('slid'+id);	
	});
	
	$('.cat').mouseover(function() {
		var id = $(this).attr('class').replace('chunk cat cat-', '');
		killTimer();
		startSlider(id);
		$('#slide-'+id).addClass('slid'+id);
	});
	
	$('.cat').bind('mouseout', function() {
		var id = $(this).attr('class').replace('chunk cat cat-', '');
		var slidelink = 'a#slide-'+id;
 		killTimer();
 		startTimer(id);		
		$('#slide-'+id).removeClass('slid'+id);
	});

	$('ul#subnav').hover(
		function() {
			$('a.parent').addClass('active');
		},
		function() {

	} );	


///////- 		Who We Are		 -////////	

	$('.who-link').mouseenter(function() {
		var id = ($(this).attr('id')).replace('who-', '');
 		killTimer();
		timerRunning = true;
 		timer = setTimeout("toggleWhoSlider('"+id+"')", 400);
		$(this).addClass('who-slid'+id);	
	});

	$('.who-link').mouseleave(function() {
		var id = ($(this).attr('id')).replace('who-', '');
 		killTimer();
		timer = setTimeout("hideWhoSlide('"+id+"')", 200);
		timerRunning = true;
		$('#who-'+id).removeClass('who-slid'+id);
	});
});