//////////////////////////////////////////
//  Delay Plugin
/////////////////////////////////////////
(function($){
	$.fn.delay = function(time, callback){
		jQuery.fx.step.delay = function(){};
		return this.animate({delay:1}, time, callback);
	}
})(jQuery);

$(document).ready(function(){
  
  // external links
	$('a[rel=external]').click(function(){
		window.open(this.href);
		return false;   
	});
	
  //Build Menu
  $('#header #menu li a, #footer .menu li a').each(function(){
    $(this).after('<span class="hover-left"></span><span class="hover-right"></span>');
  });

  //Menu Hover    
  $('#header #menu a, #footer .menu a').hover(
    function(){
      $(this).siblings().addClass('hover');  
    },
    function(){
      $(this).siblings().removeClass('hover');    
    }
  );
  
  //Slides
  if(jQuery.fn.cycle) {
		$('div.slide').delay(2500, function(){
			$(this).cycle({ 
				speed : 3000, 
				timeout : 2500
			});
		});
	}
	
	//Founders Hovers

  $('#founders ul li').hover(function(){
     $(this).addClass('hover');
     $id = $(this).attr('id');
     $('#bios > div.'+$id).show();
    },function(){
     $(this).removeClass('hover') ;
     $id = $(this).attr('id');
     $('#bios > div.'+$id).hide();
    } 
  ); 

  
  if(jQuery.fn.fancybox){
    $("a.fancy").fancybox({
  		'zoomSpeedIn':		300, 
  		'zoomSpeedOut':	300,
  		'hideOnContentClick': true,
  		'frameWidth': 692,
  		'frameHeight': 520,
  		'hideOnContentClick': false,
  		scrolling: 'no',
  		autoDimensions: false
  	});
  }
		
});
