var SP = (function(sp, $){
	var nav, bigBox;
	
	nav = {
		link : {},
		
		animateMouseOver : function(){
			$(this).stop().animate({color:'#ffffff'},250);
		},
		
		animateMouseOut : function(){
			$(this).stop().animate({color:'#000000'},250);
		},
		
		init : function(){
			this.link = $('#nav li a:not(.current)');
		}
			
	};
	
	bigBox = {
		head : {},
		body : {},
		
		adjustWidth : function(){
			var totalWidth = this.head.width();
			var imgWidth = this.head.img.width();
			var h2Width = totalWidth - imgWidth;
			this.head.h2.wrapInner('<div />');
			this.head.h2.width(h2Width);
			this.head.h2.css('width',h2Width+'px');
		},
		
		placeWatermark : function(){
			var watermark = this.body.leftDiv.attr('rel');
			if( watermark ) {
				this.body.leftDiv.css('background-image','url('+watermark+')');
			}
		},
		
		init : function(){
			this.head = $('.bigBox .bigBoxHead');
			this.head.img = this.head.find('img:eq(0)');
			this.head.h2 = this.head.img.next('h2');
			this.body.leftDiv = $('.bigBox .bigBoxBody .leftDiv');			
		}
			
	};
	
	$(function(){
		nav.init();
		nav.link.mouseover(nav.animateMouseOver).mouseout(nav.animateMouseOut);
		
		bigBox.init();
		bigBox.adjustWidth();
		bigBox.placeWatermark();
		
	});
	return sp;
})(SP || {}, jQuery);

/* added to scroll to bottom of page with contact button */
         $(function () {
             $('#scrlBotm').click(function () {
                 $('html, body').animate({
                     scrollTop: $(document).height()
                 },
                 1500);
                 return false;
             });

             $('#scrlTop').click(function () {
                 $('html, body').animate({
                     scrollTop: '0px'
                 },
                 1500);
                 return false;
             });
         });

