(function($j){

	Code.registerNamespace('Website');

	/*
	 * Class: Website.Core
	 */
	Website.Core = {
		
		/*
		 * Function: _replaceFonts
		 */
		_replaceFonts: function(){	
			
			Cufon.replace(
				'#NavigationPrimary li', 
				{ 
					fontFamily: 'Archer Bold',
					fontSize: '18px',
					separate: 'none',
					hover: { color: 'white' }
				}
			);
			
			Cufon.replace(
				'#NavigationPrimary h1',
				{
					fontFamily: 'Archer Bold',
					fontSize: '53px',
					separate: 'none'
				}
			);
			
			Cufon.replace(
				'#content h1.title a',
				{
					fontFamily: 'Archer Bold',
					fontSize: '30px'
				}
			);
			
			Cufon.replace(
				'#sidebar h2',
				{
					fontFamily: 'Archer Bold',
					fontSize: '22px'
				}
			);
								
			Website.Core.onFontReplaced();
				
		},
	
		/*
		 * Function: onReady
		 */
		onReady: function(){
			var self = this;
			
			self._setHorizontalScrollBars();
			$j(window).resize(function(){
				self._setHorizontalScrollBars();
			});
			
			$j('a.js-external').click(function(e){
				e.preventDefault();
				window.open(this.href);
			});
		},
		
		
		/*
		 * Function: onFontReplaced
		 */
		onFontReplaced: function(){
			if (Code.UserAgent.isIE8){
				// Fix for ie8 and rendering issues
				$j('body').css({padding: 0});
			}
		},
		
		
		/*
		 * Function: _setHorizontalScrollBars
		 */
		_setHorizontalScrollBars: function(){
			if ($j(window).width() < 1000){
				$j('body').css({overflowX: 'auto'});
			}
			else {
				$j('body').css({overflowX: 'hidden'});
			}
		}

	};

	
	Website.Core._replaceFonts();
	
	$j().ready(function(){
		Website.Core.onReady();
	});

})(jQuery);


