
jQuery(document).ready(function() {
	site.global();
});

// Module pattern:
// http://yuiblog.com/blog/2007/06/12/module-pattern
var site = (function($) {
	return {
		// Start It
		global: function() {
			for (var i in site.init) {
				site.init[i]();
			}
		},



		init: {
			
			
			nav_hover: function()
			{
				
				$('ul.subsites li a').hover(function() {
					
					$(this).stop().animate({
						backgroundColor: '#a95525',
						height: '150px',
					}, 300);
					
				
				}, function() {
				
					$(this).stop().animate({
						backgroundColor: '#b2b2b2',
						height: '135px',
					}, 300);
				
				
				});
			
			
			
			},

			
			
			
			
						// For all the happy images on the home page
			image_scroller: function() 
			{
				$('#scroller_1').innerfade({
							animationtype: 'fade',
							speed: 3000,
							timeout: 6000,
							/*type: 'random',*/
							containerheight: '287px'
						});
						
						
				$('#scroller_2').innerfade({
							animationtype: 'fade',
							speed: 3000,
							timeout: 10000,
							/*type: 'random',*/
							containerheight: '161px'
						});
						
						
						
				$('#scroller_3').innerfade({
							animationtype: 'fade',
							speed: 3000,
							timeout: 3000,
							/*type: 'random',*/
							containerheight: '161px'
						});
						
						
						
				
			},




			placeholder: function()
			{
				$('input').each(function() {
					var placeholder = $(this).attr('placeholder');
					if (placeholder)
					{
						$(this).val(placeholder);
					}
				});
				
				
				$('input').focus(function(){
					var placeholder = $(this).attr('placeholder');
					if ($(this).val() === placeholder)
					{
						$(this).val('');
					}
				});
				

				$('input').blur(function(){
					var placeholder = $(this).attr('placeholder');
					if ($(this).val() === '')
					{
						$(this).val(placeholder);
					}
				});


				
			},



			home_news: function()
			{
				$('#news_scroller').innerfade({
					animationtype: 'fade',
					speed: 1000,
					timeout: 6000,
					type: 'sequence',
					containerheight: '70px'
				});
			
			},
			
			
			
			lightbox: function()
			{		
				$("ul.project_gallery a").fancybox({
				    'transitionIn'	:	'elastic',
				    'transitionOut'	:	'elastic',
				    'speedIn'		:	600, 
				    'speedOut'		:	200, 
				    'overlayShow'	:	true
				});               
			}
		

			
			
			
		},
		
		
		
		
	};
// Pass in jQuery ref.
})(jQuery, this);






